SonnyB
SonnyB

Reputation: 269

How to get recordID of CKReference

I'm using CloudKit and I have two record types. Record type B contains a CKReference to record type A. I'm not having any trouble getting record type B, including the CKReference data of record type A, but I can't figure out how to get the recordID from the CKReference record (record type A). Can anyone tell me how to do that?

Thanks!

Upvotes: 0

Views: 317

Answers (1)

farktronix
farktronix

Reputation: 3950

recordID is a property of CKReference. Fetch the value from the record for the reference, then access the recordID property on that value.

For example, if your reference value was named "AReference":

recordB[@"AReference"].recordID

Upvotes: 3

Related Questions