Instance Method


Initializes and returns a record zone object with the specified name.


- (instancetype)initWithZoneName:(NSString *)zoneName;



The name of the new zone. Zone names inside a user’s private database are unique, consist of ASCII characters, are no longer than 255 characters, and do not start with an underscore (_) character. One way to ensure the uniqueness of zone names is to create a string based on a UUID, but you can also use other techniques.

If this parameter is nil or is an empty string, the method throws an exception.

Return Value

The new custom zone, or nil if the zone cannot be created.


Use this method to create a new record zone. The new zone has the name you provide and the zone’s owner is set to the current user. After creating the zone, save it to the server using a CKModifyRecordZonesOperation object or the saveRecordZone:completionHandler: method of the CKDatabase class. You must save the zone to the server before attempting to save any records to that zone.

Do not use this method to create a CKRecordZone object corresponding to a zone that already exists in the database. If the zone exists, fetch it using a CKFetchRecordZonesOperation object or the fetchRecordZoneWithID:completionHandler: method of the CKDatabase class.

See Also

Initializing a Record Zone

- initWithZoneID:

Initializes and returns a record zone object using the specified ID.