Instance Method

decodeObject

Decodes and returns an object that was previously encoded with any of the encode…Object methods.

Declaration

- (id)decodeObject;

Discussion

NSCoder’s implementation invokes decodeValueOfObjCType:at: to decode the object data.

Subclasses may need to override this method if they override any of the corresponding encode…Object methods. For example, if an object was encoded conditionally using the encodeConditionalObject: method, this method needs to check whether the object had actually been encoded.

See Also

Decoding General Data

- decodeArrayOfObjCType:count:at:

Decodes an array of count items, whose Objective-C type is given by itemType.

- decodeBoolForKey:

Decodes and returns a boolean value that was previously encoded with encodeBool:forKey: and associated with the string key.

- decodeBytesForKey:returnedLength:

Decodes a buffer of data that was previously encoded with encodeBytes:length:forKey: and associated with the string key.

- decodeBytesWithReturnedLength:

Decodes a buffer of data whose types are unspecified.

- decodeDataObject

Decodes and returns an NSData object that was previously encoded with encodeDataObject:. Subclasses must override this method.

- decodeDoubleForKey:

Decodes and returns a double value that was previously encoded with either encodeFloat:forKey: or encodeDouble:forKey: and associated with the string key.

- decodeFloatForKey:

Decodes and returns a float value that was previously encoded with encodeFloat:forKey: or encodeDouble:forKey: and associated with the string key.

- decodeIntForKey:

Decodes and returns an int value that was previously encoded with encodeInt:forKey:, encodeInteger:forKey:, encodeInt32:forKey:, or encodeInt64:forKey: and associated with the string key.

- decodeIntegerForKey:

Decodes and returns an NSInteger value that was previously encoded with encodeInt:forKey:, encodeInteger:forKey:, encodeInt32:forKey:, or encodeInt64:forKey: and associated with the string key.

- decodeInt32ForKey:

Decodes and returns a 32-bit integer value that was previously encoded with encodeInt:forKey:, encodeInteger:forKey:, encodeInt32:forKey:, or encodeInt64:forKey: and associated with the string key.

- decodeInt64ForKey:

Decodes and returns a 64-bit integer value that was previously encoded with encodeInt:forKey:, encodeInteger:forKey:, encodeInt32:forKey:, or encodeInt64:forKey: and associated with the string key.

- decodeNXObject

Decodes an object previously written with encodeNXObject:.

Deprecated
- decodeObjectForKey:

Decodes and returns a previously-encoded object that was previously encoded with encodeObject:forKey: or encodeConditionalObject:forKey: and associated with the string key.

- decodePoint

Decodes and returns an NSPoint structure that was previously encoded with encodePoint:.

- decodePointForKey:

Decodes and returns an NSPoint structure that was previously encoded with encodePoint:forKey:.

- decodePropertyList

Decodes a property list that was previously encoded with encodePropertyList:.

- decodeRect

Decodes and returns an NSRect structure that was previously encoded with encodeRect:.

- decodeRectForKey:

Decodes and returns an NSRect structure that was previously encoded with encodeRect:forKey:.

- decodeSize

Decodes and returns an NSSize structure that was previously encoded with encodeSize:.

- decodeSizeForKey:

Decodes and returns an NSSize structure that was previously encoded with encodeSize:forKey:.

- decodeValueOfObjCType:at:

Decodes a single value, whose Objective-C type is given by valueType.

Deprecated
- decodeValueOfObjCType:at:size:

Decodes a single value of a known type from the specified data buffer.

- decodeValuesOfObjCTypes:

Decodes a series of potentially different Objective-C types.

- decodeObjectOfClass:forKey:

Decodes an object for the key, restricted to the specified class.

- decodeObjectOfClasses:forKey:

Decodes an object for the key, restricted to the specified classes.

- decodePropertyListForKey:

Returns a decoded property list for the specified key.