I’m using Core Data with CloudKit and encountering issues fetching records via the CloudKit Database web interface. When I attempt to query the records, I receive an error regarding the recordName.
I found this document stating that “To search for records in this way, you must first add a queryable index for that record type’s recordName.”
https://developer.apple.com/documentation/cloudkit/managing_icloud_containers_with_cloudkit_database_app/handling_an_icloud_container_s_data#3404774
Following the documentation, I added an index for recordName which allows me to query records. However, this only displays records created in the web interface. Records added programmatically do not appear in the query results.
Do I need to add an additional field in Core Data named recordName?
What are recordName and __recordID in CloudKit and how do these work with Core Data entities?