Instance Method

fetchAllRecordZonesWithCompletionHandler:

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

Declaration

- (void)fetchAllRecordZonesWithCompletionHandler:(void (^)(NSArray<CKRecordZone *> *zones, NSError *error))completionHandler;

Parameters

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:

zones

An array of CKRecordZone objects. The returned array always contains at least one record zone corresponding to the default zone.

error

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

Discussion

Use this method to locate the record zones in this database. Record zones represent groups of records with a common purpose.

This method fetches record zones with a low priority, which may cause the task to execute after higher-priority tasks. To fetch record zones more urgently, create a CKFetchRecordZonesOperation object with the desired priority.

See Also

Accessing Record Zones

- fetchRecordZoneWithID:completionHandler:

Fetches one record zone 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.