An object that uniquely identifies a record zone in a database.


@interface CKRecordZoneID : NSObject


Zones are a way to group related records together. You create zone ID objects when you want to fetch an existing zone object or create a new zone with a specific name.

A record zone ID distinguishes one zone from another by a name string and the ID of the user that created the zone. Both strings must be ASCII strings that do not exceed 255 characters. For automatically created record zones, the ID name string is based on a UUID and is therefore guaranteed to be unique. When creating your own record zone ID objects, you are free to use names that have more meaning to your app or to the user, providing each zone name is unique within the specified database. The owner name must be either the current user name (obtained from the fetchUserRecordIDWithCompletionHandler: method) or the name of another user.

When creating new record zones, make the name string in the record zone ID unique in the target database. Public databases do not support custom zones, and zones in a private database can only be created by the user that owns the database.

This class is not intended to be subclassed.

Interacting with Record Zone IDs

After you create a CKRecordZoneID object, interactions with that object typically include:

  • Creating a CKRecordID object so that you can fetch or create records in that zone.

  • Retrieving an existing CKRecordZone object from the database.

You do not need to create a CKRecordZoneID object in order to create a CKRecordZone object. The CKRecordZone class has initialization methods that create a record zone ID using the name string you provide.

Creating Record Zone IDs to Use with Records

To create a new record in a custom zone, first create a CKRecordZoneID object that specifies the zone name. Use the record zone ID to create a CKRecordID and then use the record ID to create the record itself.

Fetching a Record Zone Object from the Database

To fetch a CKRecordZone object from a database, use a CKFetchRecordZonesOperation object or the fetchRecordZoneWithID:completion: method of the CKDatabase class. Both techniques take a CKRecordZoneID object that you provide and retrieve the corresponding record zone object asynchronously. If you use the operation object, you can retrieve multiple record zones at the same time.


Initializing a Record Zone ID

- initWithZoneName:ownerName:

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

Getting the Record Zone ID Attributes


The unique name of the record zone.


The ID of the user who owns the record zone.


Inherits From

See Also

Getting the Zone Attributes


The unique ID of the zone.


The capabilities supported by the zone.