如何获取数据库中的RecordTypes列表? [英] How do I get a list of RecordTypes in a Database?

查看:170
本文介绍了如何获取数据库中的RecordTypes列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想列出数据库中的所有记录.

I want to list all records in a Database.

要使用CKQuery进行此操作,看来我必须具有recordType.谓词将是TRUEPREDICATE.

To do this using CKQuery, it appears I must have a recordType. The predicate will be TRUEPREDICATE.

如何获取RecordTypes列表以供最终在CKQuery中使用? (例如,我将遍历该列表,并在运行时创建新的CKQuery对象.)

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.)

推荐答案

看起来似乎很奇怪,但是无法确定Cloud Kit数据库中存在哪些记录类型.您的代码应该创建具有特定记录类型的记录,因此您的代码应该已经知道存在哪些记录类型.

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.

这篇关于如何获取数据库中的RecordTypes列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆