Ios CloudKit获取所有用户记录

Ios CloudKit获取所有用户记录,ios,objective-c,cloudkit,Ios,Objective C,Cloudkit,我想获取在我的应用程序的同一公共默认容器中工作的所有用户。 是否可以获取所有用户ID 当我尝试这样做时: NSPredicate *predicate = [NSPredicate predicateWithFormat:@"TRUEPREDICATE"]; // to search for all the records CKQuery *query = [[CKQuery alloc] initWithRecordType:@"Users" predicate:predicate]; [_p

我想获取在我的应用程序的同一公共默认容器中工作的所有用户。 是否可以获取所有用户ID

当我尝试这样做时:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"TRUEPREDICATE"]; // to search for all the records
CKQuery *query = [[CKQuery alloc] initWithRecordType:@"Users" predicate:predicate];
[_publicDB performQuery:query inZoneWithID:nil completionHandler:^(NSArray *results, NSError *error) {
    if (error) {
        // Error handling for failed fetch from public database
        NSLog(@"Error:%@", error);
    }
    else {
        // Display the fetched records
        NSLog(@"Users: %@", results);
    }
}];
我得到一个类似这样的错误:

Error:<CKError 0x7f9c6b7331f0: "Permission Failure" (10/2007); server message = "Can't query system types"; uuid = 9CBA8EB0-D9DC-46B2-BDF4-10C036599642; container ID = "iCloud.com.xxx.xxx.MyApp">
错误:

你知道我怎样才能做到这一点吗?我想从客户端角度(iOS)了解使用我的应用程序的其他用户。

用户记录类型是一种特殊的记录类型,您无法查询。如果要执行此类查询,则应创建自己的记录类型,并为每个用户插入一条记录

谢谢你的确认。我还在考虑一种新的记录类型,它可以存储索引用户ID。谢谢你的快速回复。老实说,用户记录类型应该能够避免重复数据,就像我的情况一样;)在过去,该表还包含了名字和姓氏。我猜出于隐私原因,查询用户是有限的。一旦您的CloudKit应用程序投入生产,您能否在CloudKit仪表板中看到每个使用您的应用程序的
用户的iCloud用户ID?