Instance Method

deleteRecordZoneWithID:completionHandler:

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

Declaration

- (void)deleteRecordZoneWithID:(CKRecordZoneID *)zoneID completionHandler:(void (^)(CKRecordZoneID *zoneID, NSError *error))completionHandler;

Parameters

zoneID

The ID of the zone you want to delete. 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:

zoneID

The ID of the zone that you tried to delete.

error

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

Discussion

Deleting a zone permanently deletes the zone and all records in that zone. After deleting the zone, you can use the same ID to create a new empty zone.

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

See Also

Accessing Record Zones

- fetchAllRecordZonesWithCompletionHandler:

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

- 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.