gpt4 book ai didi

ios - Quickblox - 如何使用带有参数 IOS 的自定义对象显示数据

转载 作者:行者123 更新时间:2023-11-29 12:22:50 25 4
gpt4 key购买 nike

我正在开发一个应用程序,并且正在处理一个我想要过滤的联系人列表。因此,我正在使用 quickblox 的自定义对象,这是我的代码:

- (NSArray *)idsFromContactListItems { 
NSMustableArray *idsToFetch = [NSMustableArray new];
NSArray *contactListItems = self.contactList;
for (QBContactListItem *item in contactListItems) {
NSMutableDictionary *getRequest = [NSMutableDictionary new];
[getRequest setObject:@"personal" forKey:@"identifier"];
if ([QBCustomObjects objectsWithClassName=@"cards" extendedRequest:getRequest delegate:self]){
idsToFetch addObject:@(item.userID)];}
else {};
}
return idsToFetch;
};

我的数组 idsToFetch 返回所有值,但在我的自定义对象类中只有 1 个具有个人标识符。

最佳答案

[QBCustomObjects objectsWithClassName=@"cards"extendedRequest:getRequest delegate:self] 将在 self 上调用 completedWithResult: 方法(请注意,这是已弃用的 api,它是在最新的 2.3.0.4 中删除,但在最新的 2.2.5 SDK 中仍然可用,并支持旧的 API 1.x)

[QBCustomObjects objectsWithClassName=@"cards" extendedRequest:getRequest delegate:self]

会打电话

- (void)completedWithResult:(QBResult *)result {
// in result you will have QBCOCustomObjectPagedResult
QBCOCustomObjectPagedResult *res = (QBCOCustomObjectPagedResult *)result;
// to get your items in array with identifier == presonal you can use
NSArray *customObjects = res.objects;

}

关于ios - Quickblox - 如何使用带有参数 IOS 的自定义对象显示数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30095339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com