Instance Method

encodeConditionalObject:

An encoding method for subclasses to override to conditionally encode an object, preserving common references to it.

Declaration

- (void)encodeConditionalObject:(id)object;

Discussion

In the overriding method, object should be encoded only if it’s unconditionally encoded elsewhere (with any other encode...Object: method).

This method must be matched by a subsequent decodeObject message. Upon decoding, if object was never encoded unconditionally, decodeObject returns nil in place of object. However, if object was encoded unconditionally, all references to object must be resolved.

NSCoder’s implementation simply invokes encodeObject:.

See Also

Encoding General Data

- encodeArrayOfObjCType:count:at:

Encodes an array of the given Objective-C type, provided the number of items and a pointer.

- encodeBool:forKey:

Encodes a Boolean value and associates it with the string key.

- encodeBycopyObject:

An encoding method for subclasses to override such that it creates a copy, rather than a proxy, when decoded.

- encodeByrefObject:

An encoding method for subclasses to override such that it creates a proxy, rather than a copy, when decoded.

- encodeBytes:length:

Encodes a buffer of data of an unspecified type.

- encodeBytes:length:forKey:

Encodes a buffer of data, given its length and a pointer, and associates it with a string key.

- encodeConditionalObject:forKey:

An encoding method for subclasses to override to conditionally encode an object, preserving common references to it, only if it has been unconditionally encoded.

- encodeDataObject:

Encodes a given data object.

- encodeDouble:forKey:

Encodes a double-precision floating point value and associates it with the string key.

- encodeFloat:forKey:

Encodes a floating point value and associates it with the string key.

- encodeInt:forKey:

Encodes a C integer value and associates it with the string key.

- encodeInteger:forKey:

Encodes an integer value and associates it with the string key.

- encodeInt32:forKey:

Encodes a 32-bit integer value and associates it with the string key.

- encodeInt64:forKey:

Encodes a 64-bit integer value and associates it with the string key.

- encodeNXObject:

Encodes an old-style object onto the coder.

Deprecated
- encodeObject:

Encodes an object.

- encodeObject:forKey:

Encodes an object and associates it with the string key.

- encodePoint:

Encodes a point.

- encodePoint:forKey:

Encodes a point and associates it with the string key.

- encodePropertyList:

Encodes a property list.

- encodeRect:

Encodes a rectangle structure.

- encodeRect:forKey:

Encodes a rectangle structure and associates it with the string key.

- encodeRootObject:

An encoding method for subclasses to override to encode an interconnected group of objects, starting with the provided root object.

- encodeSize:

Encodes a size structure.

- encodeSize:forKey:

Encodes a size structure and associates it with the given string key.

- encodeValueOfObjCType:at:

Encodes a value of the given type at the given address.

- encodeValuesOfObjCTypes:

Encodes a series of values of potentially differing Objective-C types.