0

I have a CKReference attached to 4000 records linked to one CKRecord. They have no action (CKReferenceActionNone).
I want to be able to fetch all these records using, CKQueryOperation using NSPredicate as follows:

CKReference* recordToMatch = [[CKReference alloc] initWithRecordID:backupRecord.recordID action:CKReferenceActionNone]; NSPredicate* predicate = [NSPredicate predicateWithFormat:@"parentRecord == %@", recordToMatch];

Normally when I use CKQueryOperation I can loop it using CKQueryCursor to fetch over 100 records. But using CKReference, it works the first 100 and then 200, but after than no cursor is returned.

Is there any way to fetch 4000 records using CKReference?

Thanks a lot!

Ken Chan
  • 21
  • 1
  • 3

1 Answers1

0

I’m unsure if this is the exact cause of your cursor issue, but there is a limit of 750 references per record.

There is a hard limit to the number of references any one record can have. This limit is set to 750 references. Any attempt to exceed this limit will result in an error from the server.

You can see that documented here: https://developer.apple.com/documentation/cloudkit/ckrecord/reference

Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
  • 1
    That shouldn’t have an effect here. With CKReferenceActionNone that limit shouldn’t apply. I have tested with thousands of referenced records successfully. – Brian M Jun 19 '18 at 12:46
  • 1
    I have successfully added thousands of referenced records also. But fetching them has been not worked since I am using CKShare also. So the user fetching the records is actually fetching another user's private zone via the CKShare -> CKReference. – Ken Chan Jul 03 '18 at 12:36