Questions tagged [ckreference]

31 questions
11
votes
1 answer

Saving An Array Of Objects In CloudKit

I'm confused about how to best save an object that contains an array of other objects in CloudKit. Say I have a todo list app, which has different collections of items. How would I go about saving/fetching a whole collection of items? Would I have a…
William Robinson
  • 1,038
  • 17
  • 32
10
votes
1 answer

Is there a limit to the number of CKReferenced records in CloudKit?

I am trying to store groups of contacts in CloudKit, and I am getting an error back if I try to create a large group of records, CKReferenced to a single group record. The limit appears to be around 700 or so records. Has anyone else seen a…
Peter Johnson
  • 3,764
  • 1
  • 23
  • 27
8
votes
1 answer

CloudKit Delete Self option for CKReference Doesn't work

Does anybody have experience using the CloudKit option to DeleteSelf for a CKReference? Here is what I got from the docs: DeleteSelf The delete action for referenced records. Deleting a record also deletes any records containing CKReference…
Pierce
  • 3,148
  • 16
  • 38
8
votes
2 answers

What is the best practice approach to fetching CKReferences in CloudKit?

In my CloudKit setup I have a Person record type and each person has a Friend attribute which is a CKReference to another Person object. I fetch all Person CKRecords. I list these people in a table and list their friends with them. Currently I just…
Josh Kahane
  • 16,765
  • 45
  • 140
  • 253
6
votes
2 answers

CKReference .DeleteSelf attribute has no effect

How does .DeleteSelf really work? Docs says: When the reference object’s action is set to CKReferenceActionDeleteSelf, the target of the reference—that is, the record stored in the reference’s recordID property—becomes the owner of the source…
János
  • 32,867
  • 38
  • 193
  • 353
5
votes
1 answer

CKReference on CloudKit using Swift

I have a RecordType Account and another one Friends. For Account I am setting the RecordID on creation of each record and I have a column Name. For Friends I have two columns, Me and MyFriend. MyFriend is a Reference containing the RecordID of an…
Andreas Xenos
  • 335
  • 1
  • 3
  • 7
4
votes
0 answers

how to get multiple record types linked via CKreference from cloud kit

I create a series of CK references with a contact having mutiple locations, each locaiton ahving a provider and each provider having a meter and so forth let self.currentLocationCkRecord["ownningContact"] = CKReference(record:…
vrao
  • 545
  • 2
  • 12
  • 33
4
votes
2 answers

CloudKit Subscription Notification for CKReference Not Working As Expected

I'm trying to setup a CKSubscription for records that contain a field with a CKReference to the user. But anytime a record is created, it ignores this part of the compoundPredicate and the notification never comes. Is there something different…
Renee Olson
  • 267
  • 1
  • 15
3
votes
0 answers

CloudKit relationships CKReference setup and query.

I’m allowing Users to save locations. It is saving in cloudKit, I can fetch all the locations successfully. For each location saved there is a record who created it "created by: IDXXX". How do I pull all the locations saved by the single user who…
julien
  • 437
  • 4
  • 9
2
votes
1 answer

How do I store a reference to a shared record in CloudKit

I want to store the users preference in CloudKit attached to the users public User record. The preference can be either a private record or a shared record (shared by some other user). Can I use CKReference to store a reference to the shared…
Duncan Groenewald
  • 8,496
  • 6
  • 41
  • 76
2
votes
1 answer

Create Reference List Pointing to Multiple CKRecords in CloudKit

Swift 3.1, Xcode 8.3.3 I have a record type in CloudKit called Aircraft and it has a field called fieldValues that is of type Reference List. In my code, I have an aircraft CKRecord and several fieldValue CKRecords that are children of the aircraft.…
Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
2
votes
1 answer

cloudkit enter userID as reference of a new record (in code)

I am setting an app in which a user could create records. Let's say he/she is the owner of a chatroom. Therefore there is an attribute called "admin" in the chatroom record. This attribute takes a reference which is the ID of the owner. Here is what…
Quentin Malgaud
  • 405
  • 6
  • 21
1
vote
0 answers

Unable to fetch the record from CKContainer.default().userRecordID() after deploying CloudKit from Development to Production

I have just built my first app that uses CloudKit and is working fine in the development environment. I have now deployed my container to Production but while testing in this production environment, the app does not work. The user creates a profile…
Sourabh
  • 31
  • 4
1
vote
1 answer

Saving a CKRecordID to CloudKit

I have a CKRecordID that I need to save to CloudKit as a reference. However when I try to save it, I get the following Error: Cannot convert value of type 'CKRecordID?' to expected argument type 'CKRecordValue?' Declaration of…
user4174219
  • 427
  • 5
  • 13
1
vote
0 answers

Executing a CKQueryOperation with predicate based on CKReference not returning all "owned records"

My schema is as follows RecordType: OwnedEvents contains an element called "Owner". This Owner element points to CKReference created from a RecordType of type "OwnedEvents". I have N OwnedEvents objects all pointing to one Owner object. When I…
1
2 3