Instance Method

initWithRecordName:zoneID:

Initializes and returns a new record ID with the specified name and zone information.

Declaration

- (instancetype)initWithRecordName:(NSString *)recordName zoneID:(CKRecordZoneID *)zoneID;

Parameters

recordName

The name to use to identify the record. The string must contain only ASCII characters, must not exceed 255 characters, and must not start with an underscore. If you specify nil or an empty string for this parameter, this method throws an exception.

zoneID

The ID of the zone in which to place the record. This parameter must not be nil.

Return Value

An initialized record ID object or nil if the object cannot be created.

Discussion

Use this method when you create or search for records in a zone other than the default zone. The value in the zoneID parameter must represent a zone that already exists in the database. If the record zone does not exist yet, save the corresponding CKRecordZone object to the database before attempting to save any CKRecord objects in that zone.

See Also

Initializing a Record ID

- initWithRecordName:

Initializes and returns a new record ID with the specified name in the default zone.