我正在开发一个应用程序,并且正在研究一个要过滤的联系人列表。因此,我正在使用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中删除,但仍在具有旧API 1.x支持的最新2.2.5 SDK中提供)

[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/

10-12 14:29