Protocol: NSKeyedUnarchiverDelegate

Overview

The NSKeyedUnarchiverDelegate protocol defines the optional methods implemented by delegates of NSKeyedUnarchiver objects.Informs the delegate that the class with a given name is not available during decoding.Informs the delegate that a given object has been decoded.Informs the delegate that one object is being substituted for another.Notifies the delegate that decoding has finished.Notifies the delegate that decoding is about to finish.

Instance Method Summary (collapse)

Instance Method Details

- (Class) unarchiver(unarchiver, cannotDecodeObjectOfClassName:name, originalClasses:classNames)

Informs the delegate that the class with a given name is not available during decoding. The delegate may, for example, load some code to introduce the class to the runtime and return the class, or substitute a different class object. If the delegate returns nil, unarchiving aborts and the method raises an NSInvalidUnarchiveOperationException.

Parameters:

  • unarchiver (NSKeyedUnarchiver)

    An unarchiver for which the receiver is the delegate.

  • name (String)

    The name of the class of an object unarchiver is trying to decode.

  • classNames (Array)

    An array describing the class hierarchy of the encoded object, where the first element is the class name string of the encoded object, the second element is the class name of its immediate superclass, and so on.

Returns:

  • (Class)

    The class unarchiver should use in place of the class named name.

- (Object) unarchiver(unarchiver, didDecodeObject:object)

Informs the delegate that a given object has been decoded. This method is called after object has been sent initWithCoder: and awakeAfterUsingCoder:.The delegate may use this method to keep track of the decoded objects.

Parameters:

  • unarchiver (NSKeyedUnarchiver)

    An unarchiver for which the receiver is the delegate.

  • object (Object)

    The object that has been decoded. object may be nil.

Returns:

  • (Object)

    The object to use in place of object. The delegate can either return object or return a different object to replace the decoded one. If the delegate returns nil, the decoded value will be unchanged (that is, the original object will be decoded).

- (Object) unarchiver(unarchiver, willReplaceObject:object, withObject:newObject)

Informs the delegate that one object is being substituted for another.

This method is called even when the delegate itself is doing, or has done, the substitution with unarchiver:didDecodeObject:.The delegate may use this method if it is keeping track of the encoded or decoded objects.

Parameters:

  • unarchiver (NSKeyedUnarchiver)

    An unarchiver for which the receiver is the delegate.

  • object (Object)

    An object in the archive.

  • newObject (Object)

    The object with which unarchiver will replace object.

Returns:

- (Object) unarchiverDidFinish(unarchiver)

Notifies the delegate that decoding has finished.

Parameters:

  • unarchiver (NSKeyedUnarchiver)

    An unarchiver for which the receiver is the delegate.

Returns:

- (Object) unarchiverWillFinish(unarchiver)

Notifies the delegate that decoding is about to finish.

Parameters:

  • unarchiver (NSKeyedUnarchiver)

    An unarchiver for which the receiver is the delegate.

Returns: