Contents

fetchSharesMatchingObjectIDs:error:

Returns a dictionary that contains the share records that CloudKit associates with specified managed object IDs.

Declaration

- (NSDictionary<NSManagedObjectID *,CKShare *> *) fetchSharesMatchingObjectIDs:(NSArray<NSManagedObjectID *> *) objectIDs error:(NSError **) error;

Parameters

  • objectIDs:

    An array of managed object IDs.

  • error:

    On return, an error object that contains information about a problem, or nil if the method successfully fetches the share records.

Return Value

A dictionary that uses objectIDs as its keys, and the associated share records as its values.

Discussion

If a specified managed object doesn’t belong to a shared record zone, or if Core Data has yet to save the object to iCloud and, therefore, its record zone is unknown, the returned dictionary doesn’t include it.

Use a fetched share record to manage its participants and their permissions, or assign data directly to it. A share record is a subclass of CKRecord, which means you can store any data you choose in the underlying record to meet your specific needs. For more information, see CKShare.

If you modify a share record, you must save it using the persistUpdatedShare:inPersistentStore:completion: method.

See Also

Sharing Objects