NSKeyedArchiverDelegate Protocol Reference
| Conforms to | |
| Framework | /System/Library/Frameworks/Foundation.framework |
| Availability | Available in iOS 4.0 and later. |
| Companion guide | |
| Declared in | NSKeyedArchiver.h |
Overview
The NSKeyedArchiverDelegate protocol defines the optional methods implemented by delegates of NSKeyedArchiver objects.
Instance Methods
archiver:didEncodeObject:
Informs the delegate that a given object has been encoded.
Parameters
- archiver
The archiver that sent the message.
- object
The object that has been encoded. object may be
nil.
Discussion
The delegate might restore some state it had modified previously, or use this opportunity to keep track of the objects that are encoded.
This method is not called for conditional objects until they are actually encoded (if ever).
Availability
- Available in iOS 2.0 and later.
- Available as part of an informal protocol prior to iOS 4.0.
Declared In
NSKeyedArchiver.harchiver:willEncodeObject:
Informs the delegate that object is about to be encoded.
Parameters
- archiver
The archiver that sent the message.
- object
The object that is about to be encoded. This value is never
nil.
Return Value
Either object or a different object to be encoded in its stead. The delegate can also modify the coder state. If the delegate returns nil, nil is encoded.
Discussion
This method is called after the original object may have replaced itself with replacementObjectForKeyedArchiver::.
This method is called whether or not the object is being encoded conditionally.
This method is not called for an object once a replacement mapping has been set up for that object (either explicitly, or because the object has previously been encoded). This method is also not called when nil is about to be encoded.
Availability
- Available in iOS 2.0 and later.
- Available as part of an informal protocol prior to iOS 4.0.
Declared In
NSKeyedArchiver.harchiver:willReplaceObject:withObject:
Informs the delegate that one given object is being substituted for another given object.
Parameters
- archiver
The archiver that sent the message.
- object
The object being replaced in the archive.
- newObject
The object replacing object in the archive.
Discussion
This method is called even when the delegate itself is doing, or has done, the substitution. The delegate may use this method if it is keeping track of the encoded or decoded objects.
Availability
- Available in iOS 2.0 and later.
- Available as part of an informal protocol prior to iOS 4.0.
Declared In
NSKeyedArchiver.harchiverDidFinish:
Notifies the delegate that encoding has finished.
Parameters
- archiver
The archiver that sent the message.
Availability
- Available in iOS 2.0 and later.
- Available as part of an informal protocol prior to iOS 4.0.
Declared In
NSKeyedArchiver.harchiverWillFinish:
Notifies the delegate that encoding is about to finish.
Parameters
- archiver
The archiver that sent the message.
Availability
- Available in iOS 2.0 and later.
- Available as part of an informal protocol prior to iOS 4.0.
Declared In
NSKeyedArchiver.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-04-23)