Why does the value of the property "capabilities" of the CKRecordZone object equal to 7?

181 views Asked by At

In my iOS app, I created a custom zone and then fetched the zone by CKFetchRecordOperation. After that, I let the console print the value of the property "capabilities" of the fetched CKRecordZone. The value is 7. How can it be that?

According to the documentation, the value is of the enum type CKRecordZoneCapabilities, which has only the value 1 << 0 and the value 1 << 1. So, I don't know why the value can be 7.

1

There are 1 answers

0
LaborEtArs On

According to the iOS 10 SDK source (CKRecordZone.h) the capabilities are as follows:

typedef NS_OPTIONS(NSUInteger, CKRecordZoneCapabilities) {
    /* This zone supports CKFetchRecordChangesOperation */
    CKRecordZoneCapabilityFetchChanges   = 1 << 0,
    /* Batched changes to this zone happen atomically */
    CKRecordZoneCapabilityAtomic         = 1 << 1,
    /* Records in this zone can be shared */
    CKRecordZoneCapabilitySharing        NS_AVAILABLE(10_12, 10_0) = 1 << 2,
} NS_AVAILABLE(10_10, 8_0);

So a value of '7' seems to be quite ok (1 + 2 + 4). Your zone has got all available capabilities.