Instance Method

awakeAfterUsingCoder:

Overridden by subclasses to substitute another object in place of the object that was decoded and subsequently received this message.

Declaration

- (id)awakeAfterUsingCoder:(NSCoder *)coder;

Parameters

aDecoder

The decoder used to decode the receiver.

Return Value

The receiver, or another object to take the place of the object that was decoded and subsequently received this message.

Discussion

You can use this method to eliminate redundant objects created by the coder. For example, if after decoding an object you discover that an equivalent object already exists, you can return the existing object. If a replacement is returned, your overriding method is responsible for releasing the receiver.

This method is invoked by NSCoder. NSObject’s implementation simply returns self.

See Also

Archiving

classForArchiver

The class to substitute for the receiver's own class during archiving.

classForCoder

Overridden by subclasses to substitute a class other than its own during coding.

classForKeyedArchiver

Subclasses to substitute a new class for instances during keyed archiving.

+ classFallbacksForKeyedArchiver

Overridden to return the names of classes that can be used to decode objects if their class is unavailable.

+ classForKeyedUnarchiver

Overridden by subclasses to substitute a new class during keyed unarchiving.

classForPortCoder

Class to substitute for the receiver in distribution encoding.

Deprecated
- replacementObjectForArchiver:

Overridden by subclasses to substitute another object for itself during archiving.

Deprecated
- replacementObjectForCoder:

Overridden by subclasses to substitute another object for itself during encoding.

- replacementObjectForKeyedArchiver:

Overridden by subclasses to substitute another object for itself during keyed archiving.

- replacementObjectForPortCoder:

Overridden by subclasses to substitute another object or a copy for itself during distribution encoding.

Deprecated
+ setVersion:

Sets the receiver's version number.

+ version

Returns the version number assigned to the class.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software