1

私はアプリに取り組んでおり、フィルタリングしたい連絡先リストに取り組んでいます。したがって、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 つしかありません。

4

1 に答える 1

1

[QBCustomObjects objectsWithClassName=@"cards" extendedRequest:getRequest delegate: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;

}
于 2015-08-31T12:12:23.433 に答える