Instance Method


Adds the specified key-value pair to the record.


- (void)setObject:(id<CKRecordValue>)object forKeyedSubscript:(CKRecordFieldKey)key;



The value to assign to the specified key. The object must be one of the types listed in Supported Data Types. It is a programmer error to specify an object of any other type. Specify nil for this parameter to remove the value for the field.


The key to associate with obj. Use this key to retrieve the value later. 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. The names of your keys must not match the names of any properties of this class.


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

myRecord[@"firstName"] = @"John";

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.

- objectForKeyedSubscript:

Returns the value for the given key stored in 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.

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