Returns the value for the given key stored in the record.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+Beta
- tvOS 9.0+
- watchOS 3.0+
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.
The object associated with the specified key or
nil if no such key exists in the record.
New records do not contain any keys or values initially. Values are always one of the object types listed in Supported Data Types.
You access the fields of a
CKRecord object the same way you access key-value pairs in an
CKRecord class defines the
set methods for getting and setting values. It also supports dictionary index notation. The following example shows how to use both techniques to set a field named
first and get a field named
last from a given record.