(Preliminary Documentation) Copyright ã1994 by NeXT Computer, Inc.  All Rights Reserved.

2

Foundation Kit

Classes

NSArchiver 

Inherits From:	NSCoder : NSObject

Conforms To:	NSCoding
NSObject 

Declared In:	foundation/NSArchiver.h 

Initializing an NSArchiver

- (id)initForWritingWithMutableData:(NSMutableData *)mdata	
	Initializes an archiver, encoding stream and version information into mutable data mdata.

Archiving data 

+ (NSData *)archivedDataWithRootObject:(id)rootObject	
	Creates and returns a data object after initializing an archiver with that object and encoding the archiver with rootObject.
+ (BOOL)archiveRootObject:(id)rootObject	Archives rootObject by encoding it as a data object in
toFile:(NSString *)path		an archiver and writing that data object to file path.  Returns YES upon success.
- (void)encodeArrayOfObjCType:(const char *)type	 Encodes an array of count data elements of the same   
count:(unsigned int)count		Objective C data type.  
at:(const void *)array
- (void)encodeConditionalObject:(id)object	Encodes into the linearized data a conditional  object that points back toward a root object.  If nil is specified for object, it encodes it as nil unconditionally.  Raises an exception if no root object has been encoded.    
- (void)encodeRootObject:(id)rootObject	Encodes the rootObject at the start of the linearized data representing the object graph.  Raises an exception if the root object has already been encoded.

Getting data from the archiver

- (NSMutableData *)archiverData	Returns the data object,  in mutable form, that is associated with the receiving NSArchiver.

Substituting One Class for Another 

+ (NSString *)classNameEncodedForTrueClassName:(NSString *)trueName
	Returns the string object representing the class name used to archive instances of the class.  This class name might not be the original name (trueName):  see encodeClassName:intoClassName.
- (void)encodeClassName:(NSString *)trueName	Encodes in the archived data a substitute class name 
intoClassName:(NSString *)inArchiveName		(inArchiveName) for the real class name (trueName).