PATH |
- Inherits from:
- Object
- Package:
- com.webobjects.foundation
This class provides static methods that convert between property lists and their string representations, which can be either strings or NSData objects. A property list is a structure that represents organized data. It can be built from a combination of NSArrays, NSDictionaries, Strings, and NSData objects.
The string representation can be in XML or the ASCII plist format. To distinguish between the two formats, the parser that converts strings to property lists checks if the string starts with <?xml
. A discussion of the ASCII plist format, A Primer on ASCII Property Lists, is available in the Mac OS X section of the Apple Developer Connection website. A discussion of XML property lists, Property List Services, is also available in the same area of the Apple Developer Connection website.
Some methods do not support XML property list representations, specifically booleanForString and intForString.
The NSPropertyListSerialization class cannot be instantiated.
- Extracting typed data
- arrayForString
- booleanForString
- dictionaryForString
- intForString
- Converting to property lists
- propertyListFromData
- propertyListFromString
- Converting from property lists
- dataFromPropertyList
- stringFromPropertyList
public static NSArray arrayForString(String string)
See Also: dictionaryForString.
public static boolean booleanForString(String string)
string's value | Value returned |
"YES " |
true |
"true " |
true |
Any other value | false |
The tests for "YES
" and "true
" are case insensitive.
public static NSData dataFromPropertyList( Object object, String encoding)
public static NSData dataFromPropertyList(Object object)
See Also: stringFromPropertyList
public static NSDictionary dictionaryForString(String string)
See Also: arrayForString.
public static int intForString(String string)
null
, returns zero.
public static Object propertyListFromData( NSData data, String encoding)
public static Object propertyListFromData(NSData data)
See Also: propertyListFromString
public static Object propertyListFromString(String string)
public static String stringFromPropertyList(Object object)
© 2001 Apple Computer, Inc. (Last Published April 17, 2001)