Name
NSKeyedArchiver — Mac OS X 10.2
Synopsis
This class is a concrete subclass of NSCoder that
encodes objects and scalar values into a data format that can be
stored in
a
file.
NSKeyedArchiver is different from
NSArchiver in that each object and scalar in the
archive has an associated name or key. These keys make it possible to
decode the archive piecemeal; that is, in an order that is different
from the original encoding. Clients have the option of picking and
choosing which objects to decode. Non-keyed archives suffer from the
limitation that the entirety of an archive must be decoded at once,
and in the order that it was encoded. Archiving is described in
greater detail in Chapter 2.
|
|
@interface NSKeyedArchiver : NSCoder
|
// Initializers
|
- (id)initForWritingWithMutableData:(NSMutableData *)data; |
// Accessor Methods
|
- (void)setDelegate:(id)delegate; |
- (id)delegate;
|
- (void)setOutputFormat:(NSPropertyListFormat)format; |
- (NSPropertyListFormat)outputFormat;
|
- (void)setClassName:(NSString *)codedName forClass:(Class)cls; |
// Class Methods
|
+ (BOOL)archiveRootObject:(id)rootObject toFile:(NSString *)path; |
+ (NSData *)archivedDataWithRootObject:(id)rootObject; |
+ (NSString *)classNameForClass:(Class)cls; |
+ (void)setClassName:(NSString *)codedName forClass:(Class)cls; |
// Instance Methods
|
- (void)encodeConditionalObject:(id)objv forKey:(NSString *)key ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access