1

I am working on an app and I am working on a contact list that I want to get filtered. Therefore I am using custom objects of quickblox, here is my code:

- (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;
  };

My array idsToFetch returns all the values but there is only 1 in my custom object class that has personal in identifier.

1 Answers1

1

[QBCustomObjects objectsWithClassName=@"cards" extendedRequest:getRequest delegate:self] will call completedWithResult: method on self(please note that this is deprecated api and it was removed in the latest 2.3.0.4, but still available in the latest 2.2.5 SDK with old API 1.x support)

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

will call

- (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;

}
SevenDays
  • 3,718
  • 10
  • 44
  • 71