Documentation Archive Developer
Search
PATH  WebObjects 4.0 Documentation > EOAccess Reference



EOCustomClassArchiving

(informal protocol)

NSObject

Declared in: EOAccess/EOAttribute.h

Category Description

EOCustomClassArchiving defines methods that can be used to write any object that conforms to NSCoding to the database as binary data, as generated by NSArchiver. Since data in this fomat is neither human-readable nor readable by non-OpenStep applications, it's usually preferable to supply other custom archiving methods for your custom value classes. For a comprehensive discussion of working with custom data types, see the EOAttribute class specification and the chapter "Advanced Enterprise Object Modeling" in the Enterprise Objects Framework Developer's Guide.

For more information, see "Archiving Attributes with Custom Types" in "WebObjects Programming Topics." Is this cross-reference correct?


Class Methods


objectWithArchiveData:

+ (id)objectWithArchiveData:(NSData *)data

Returns an object created from data. NSObject's implementation of this method invokes NSUnarchiver's unarchiveObjectWithData: method and returns the result. Your custom value class can therefore take advantage of this method merely by implementing the NSCoding protocol method initWithCoder:.

See also: - archiveData


Instance Methods


archiveData

- (NSData *)archiveData

Return the receiver's value as an NSData object whose bytes can be stored in an external repository. NSObject's implementation of this method invokes NSArchiver's archivedDataWithRootObject: method and returns the result. Your custom value class can therefore take advantage of this method merely by implementing the NSCoding protocol method encodeWithCoder:.

See also: + objectWithArchiveData:





Copyright © 1998, Apple Computer, Inc. All rights reserved.