Instance Method

fetchRecordZoneWithID:completionHandler:

Fetches one record zone asynchronously, with a low priority, from the current database.

Declaration

- (void)fetchRecordZoneWithID:(CKRecordZoneID *)zoneID completionHandler:(void (^)(CKRecordZone *zone, NSError *error))completionHandler;

Parameters

zoneID

The ID of the record zone. This method throws an exception if this parameter is nil.

completionHandler

The block to execute with the results. Your block must be capable of running on any thread of the app and must take the following parameters:

zone

The requested CKRecordZone object or nil if the object is not found or cannot be retrieved.

error

An error object, or nil if the record zone was fetched successfully. Use the information in the error object to determine whether a problem has a workaround.

Discussion

Use this method to retrieve a record zone whose ID you already know. You might retrieve a record zone object so that you can assess its capabilities.

This method fetches the record zone with a low priority, which may cause the task to execute after higher-priority tasks. To fetch the record zone more urgently, create a CKFetchRecordZonesOperation object with the desired priority. You can also use that operation object to fetch multiple record zones simultaneously.

See Also

Accessing Record Zones

- fetchAllRecordZonesWithCompletionHandler:

Fetches all record zones asynchronously, with a low priority, from the current database.

- saveRecordZone:completionHandler:

Saves one record zone asynchronously, with a low priority, to the current database.

- deleteRecordZoneWithID:completionHandler:

Deletes one record zone (and its contents) asynchronously, with a low priority, from the current database.

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