Class

NSPropertyListSerialization

An object that converts between a property list and one of several serialized representations.

Declaration

@interface NSPropertyListSerialization : NSObject

Overview

The NSPropertyListSerialization class provides methods that convert a property list to and from several serialized formats. A property list is itself an array or dictionary that contains only NSData, NSString, NSArray, NSDictionary, NSDate, and NSNumber objects.

Property list objects are toll-free bridged with their respective Core Foundation types (CFDataRef, CFStringRef, and so on). See Toll-Free Bridging for more information on toll-free bridging.

Topics

Serializing a Property List

+ dataWithPropertyList:format:options:error:

Returns an NSData object containing a given property list in a specified format.

+ writePropertyList:toStream:format:options:error:

Writes a property list to the specified stream.

Deserializing a Property List

+ propertyListWithData:options:format:error:

Creates and returns a property list from the specified data.

+ propertyListWithStream:options:format:error:

Creates and returns a property list by reading from the specified stream.

Validating a Property List

+ propertyList:isValidForFormat:

Returns a Boolean value that indicates whether a given property list is valid for a given format.

Obsolete Methods

+ dataFromPropertyList:format:errorDescription:

This method is obsolete and will be deprecated soon.

Deprecated

Constants

NSPropertyListMutabilityOptions

These constants specify mutability options in property lists.

NSPropertyListFormat

These constants are used to specify a property list serialization format.

NSPropertyListReadOptions

The only read options supported are described in NSPropertyListMutabilityOptions.

Error Codes

NSPropertyListReadCorruptError

Parsing of the property list failed.

NSPropertyListReadUnknownVersionError

The version number of the property list cannot be determined.

NSPropertyListReadStreamError

Reading of the property list failed.

NSPropertyListWriteStreamError

Writing to the property list failed.

NSPropertyListWriteInvalidError

Writing failed because of an invalid property list object, or an invalid property list type was specified.

NSPropertyListErrorMinimum

The start of the range of error codes reserved for property list errors.

NSPropertyListErrorMaximum

The end of the range of error codes reserved for property list errors.

Relationships

Inherits From

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software