Retired Documents Library

Developer

Foundation Framework Reference NSSerializer Class Reference

Options
Deployment Target:

On This Page

NSSerializer

NSSerializer is obsolete and has been deprecated. Instead use NSPropertyListSerialization.

The NSSerializer class provides a mechanism for creating an abstract representation of a property list. (In Cocoa, property lists are defined to be—and to contain—objects of these classes: NSDictionary, NSArray, NSString, NSData.) The NSSerializer class stores this representation in an NSData object using an architecture-independent format, so that property lists can be used with distributed applications. NSSerializer’s companion class NSDeserializer declares methods that take the representation and recreate the property list in memory.

The NSSerializer class object provides the interface to the serialization process; you don’t create instances of NSSerializer. You might subclass NSSerializer to modify the representation it creates, for example, to encrypt the data or add authentication information.

Other types of data besides property lists can be serialized using serializeDataAt:ofObjCType:context: and deserializeDataAt:ofObjCType:atCursor:context:, declared by NSData and NSMutableData, allowing these types to be represented in an architecture-independent format. Furthermore, the NSObjCTypeSerializationCallBack protocol allows you to serialize and deserialize objects that are not property lists.

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import Foundation;

Availability


Deprecated in Mac OS X v10.2.
Not available to 64-bit applications.
  • serializePropertyList: + serializePropertyList: Deprecated in Mac OS X v10.2

    Creates a data object, serializes aPropertyList into it, and returns the data object.

    Declaration

    Objective-C

    + (NSData *)serializePropertyList:(id)aPropertyList

    Discussion

    aPropertyList must be a kind of NSData, NSString, NSArray, or NSDictionary object.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Deprecated in Mac OS X v10.2.

    Not available to 64-bit applications.

  • Serializes the property list aPropertyList into the mutable data object mdata.

    Declaration

    Objective-C

    + (void)serializePropertyList:(id)aPropertyList intoData:(NSMutableData *)mdata

    Discussion

    aPropertyList must be a kind of NSData, NSString, NSArray, or NSDictionary object. The property list is appended to mdata.

    Import Statement

    Objective-C

    @import Foundation;

    Availability

    Deprecated in Mac OS X v10.2.

    Not available to 64-bit applications.