问题
I want to list all records in a Database.
To do this using CKQuery, it appears I must have a recordType. The predicate will be TRUEPREDICATE.
How can I get a list of RecordTypes, for eventual use within CKQuery? (e.g. I'll loop through the list, and create new CKQuery objects at run time.)
回答1:
As strange as it may seem, there is no way to determine what record types exist in a Cloud Kit database. Your code should be creating records with specific record types so your code should already know what records types there are.
If you are creating records with dynamic record types, then you should keep your own list of used record types. This should probably me maintained using yet another, but known, record type.
来源:https://stackoverflow.com/questions/39808865/how-do-i-get-a-list-of-recordtypes-in-a-database