Platforms to show: All Mac Windows Linux Cross-Platform
CKRecordZoneMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | CloudKit | MBS Mac64bit Plugin | 16.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Zones are an important part of how you organize your data. The public and private databases have a single default zone. In the private database you can use CKRecordZoneMBS objects to create additional custom zones as needed. Use custom zones to arrange and encapsulate groups of related records in the private database. Custom zones support other capabilities too, such as the ability to write multiple records as a single atomic transaction.
Treat each custom zone as a single unit of data that is separate from every other zone in the database. Inside the zone, you add records as you would anywhere else. You can also create links between the records inside a zone by using the CKReferenceMBS class. However, the CKReferenceMBS class does not support cross-zone linking, so each reference object must point to a record in the same zone as the current record.
Use the CKRecordZoneMBS class as-is and do not subclass.
Creating a Custom Record Zone
For the most part, you use instances of this class to create and manage custom zones. Although you can use this class to retrieve a database’s default zone, most operations act on records in the default zone by default, so you rarely need to specify it explicitly.
To create a custom zone, use CKRecordZoneMBS to create the zone object, and then save that zone to the user’s private database using a CKModifyRecordZonesOperationMBS object. You cannot save any records in the zone until you save it to the database. When creating records, explicitly specify the zone ID if you want the records to reside in a specific zone; otherwise, they will be saved to the default zone. You cannot create custom zones in a public database.
After creating a CKRecordZoneMBS object and saving it to the database, you do not interact with the object much. Instead, most interactions occur with its associated CKRecordZoneIDMBS object, which you use to refer to the zone when creating records.
- 3 properties
- property capabilities as Integer
- property Handle as Integer
- property zoneID as CKRecordZoneIDMBS
- 3 methods
- method Constructor(zoneID as CKRecordZoneIDMBS)
- method Constructor(zoneName as string)
- method copy as CKRecordZoneMBS
- 3 shared methods
- shared method Available as Boolean
- shared method CKRecordZoneDefaultName as String
- shared method defaultRecordZone as CKRecordZoneMBS
- 3 constants
Capabilities
Constant | Value | Description |
---|---|---|
CapabilityAtomic | 2 | A capability that allows changes to multiple records to be made atomically. more |
CapabilityFetchChanges | 1 | A capability that allows you to fetch only the changed values in records. more |
CapabilitySharing | 4 |
Sharing |
This class has no sub classes.
Some methods using this class:
- CKDatabaseMBS.saveRecordZone(zone as CKRecordZoneMBS, tag as Variant = nil)
- CKModifyRecordZonesOperationMBS.Constructor(recordZonesToSave() as CKRecordZoneMBS, recordZoneIDsToDelete() as CKRecordZoneIDMBS)
- CKModifyRecordZonesOperationMBS.recordZonesToSave as CKRecordZoneMBS()
- CKModifyRecordZonesOperationMBS.setRecordZonesToSave(IDs() as CKRecordZoneMBS)
Some events using this class:
- CKDatabaseMBS.fetchAllRecordZonesCompleted(zones() as CKRecordZoneMBS, error as NSErrorMBS, tag as Variant)
- CKDatabaseMBS.fetchRecordZoneWithIDCompleted(zoneID as CKRecordZoneIDMBS, zone as CKRecordZoneMBS, error as NSErrorMBS, tag as Variant)
- CKDatabaseMBS.saveRecordZoneCompleted(zone as CKRecordZoneMBS, error as NSErrorMBS, tag as Variant)
- CKModifyRecordZonesOperationMBS.modifyRecordZonesCompleted(savedRecordZones() as CKRecordZoneMBS, deletedRecordZoneIDs() as CKRecordZoneIDMBS, operationError as NSErrorMBS)
The items on this page are in the following plugins: MBS Mac64bit Plugin.
CKRecordZoneIDMBS - CKRecordZoneNotificationMBS