Instance Method

objectForKeyedSubscript:

Returns the value for the given key stored in the record.

Declaration

- (id<CKRecordValue>)objectForKeyedSubscript:(CKRecordFieldKey)key;

Parameters

key

The string that identifies a field in the record. Key names consist of one or more alphanumeric characters and start with a letter. You may also include underscore characters if you do not use an underscore as the first character in the name. Spaces are not allowed in key names.

Return Value

The value associated with the specified key or nil if no such key exists in the record.

Discussion

Do not call this method directly. The presence of this method is required to support subscripting syntax for record objects. To retrieve a value from a record using this syntax, use code similar to the following:

id value = myRecord[@"firstName"];

See Also

Accessing the Record’s Fields

- objectForKey:

Returns the value for the given key stored in the record.

- setObject:forKey:

Sets the value for the specified key.

- setObject:forKeyedSubscript:

Adds the specified key-value pair to the record.

- allKeys

Returns an array of strings corresponding to all keys currently in the record.

- changedKeys

Returns an array of strings representing the keys that have changed recently.