Name

NSCoder — Mac OS X 10.0

Synopsis

This class defines an abstract interface for subclasses that implement object archival functionality. The Foundation framework implements five concreate subclasses: NSArchiver and NSUnarchiver are used for non-keyed archiving, while NSKeyedArchiver and NSKeyedUnarchiver provide support for keyed-archiving. NSPortCoder is used by the distributed objects system to send object proxies across a connection. For more information, see the class references for these five classes, the protocol reference for the NSCoding protocol, and Chapter 2.

image with no caption

@interface NSCoder : NSObject
                                  // Accessor Methods
   - (void)setObjectZone:(NSZone *)zone;
   - (NSZone *)objectZone;
                                  // Instance Methods
   - (BOOL)allowsKeyedCoding;
   - (void)decodeArrayOfObjCType:(const char *)itemType 
                                 count:(unsigned)count 
                                 at:(void *)array;
   - (BOOL)decodeBoolForKey:(NSString *)key;
   - (const uint8_t *)decodeBytesForKey:(NSString *)key 
                                 returnedLength:(unsigned *)lengthp;
   - (void *)decodeBytesWithReturnedLength:(unsigned *)lengthp;
   - (NSData *)decodeDataObject;
   - (double)decodeDoubleForKey:(NSString *)key;
   - (float)decodeFloatForKey:(NSString *)key;
   - (int32_t)decodeInt32ForKey:(NSString *)key;
   - (int64_t)decodeInt64ForKey:(NSString *)key;
   - (int)decodeIntForKey:(NSString *)key;
   - (NSColor *)decodeNXColor;
   - (id)decodeNXObject;
   - (id)decodeObject;
   - (id)decodeObjectForKey ...

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.