O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSKeyedUnarchiver — Mac OS X 10.2

Synopsis

This concrete subclass of NSCoder provides a means to decode objects that have been encoded in a keyed archive. The companion class NSKeyedArchiver provides the means to create such keyed archives from a set of objects. Archiving is described in greater detail in Chapter 2.

image with no caption

@interface NSKeyedUnarchiver : NSCoder
                                  // Initializers
   - (id)initForReadingWithData:(NSData *)data;
                                  // Accessor Methods
   - (void)setDelegate:(id)delegate;
   - (id)delegate;
   - (void)setClass:(Class)cls 
                                 forClassName:(NSString *)codedName;
                                  // Class Methods
   + (Class)classForClassName:(NSString *)codedName;
   + (void)setClass:(Class)cls 
                                 forClassName:(NSString *)codedName;
   + (id)unarchiveObjectWithData:(NSData *)data;
   + (id)unarchiveObjectWithFile:(NSString *)path;
                                  // Instance Methods
   - (int32_t)decodeInt32ForKey:(NSString *)key;
   - (const uint8_t *)decodeBytesForKey:(NSString *)key 
                                 returnedLength:(unsigned *)lengthp;
   - (double)decodeDoubleForKey:(NSString *)key;
   - (Class)classForClassName:(NSString *)codedName;
   - (BOOL)containsValueForKey:(NSString *)key;
   - (BOOL)decodeBoolForKey:(NSString *)key;
   - (float)decodeFloatForKey:(NSString *)key;
   - (int64_t)decodeInt64ForKey:(NSString *)key;
   - (int)decodeIntForKey:(NSString *)key;
   - (id)decodeObjectForKey:(NSString *)key;
   - (void)finishDecoding;
                                 // Methods Implemented by the Delegate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required