DekGenius.com
[ Team LiB ] Previous Section Next Section

NSCoding Mac OS X 10.0

This protocol declares an interface is adopted by classes to provide for archiving and unarchiving of instances of the class. The NSCoding protocol defines the two methods initWithCode: and encodeWithCode:. These two methods are the foundation of archiving and distribution in the Foundation framework. Each of these two methods passes an NSCoder object, which is used to perform archiving and unarchiving. The NSCoder class provides the tools to encode and decode objects and C and Objective-C data types. See the NSCoder class description and Chapter 2 for more information.

@protocol NSCoding
 // Instance Methods
   - (void)encodeWithCoder:(NSCoder *)aCoder;
   - (id)initWithCoder:(NSCoder *)aDecoder;
@end

    [ Team LiB ] Previous Section Next Section