我使用Quickblox框架进行聊天.login值设置为每个cell.row。但是一些值在cell.row中显示“0”。我附上了下面的图片,并将登录显示为数字和名称。 在代码下面,变量“testDict”有时会返回空值。
QBChatDialog *chatDialog = [ChatService shared].dialogs[idx];
NSDictionary *testDict=[ChatService shared].usersAsDictionary[@(chatDialog.recipientID)];
QBUUser *recipient = [ChatService shared].usersAsDictionary[@(chatDialog.recipientID)];
NSString *test=recipient.login == nil ? (recipient.fullName == nil ? [NSString stringWithFormat:@"%lu", (unsigned long)recipient.ID] : recipient.fullName) : recipient.login;
NSLog(@"DialogList:%@",testDict);
答案 0 :(得分:3)
最后我得到了答案。只需更改页面:nil to page:[QBGeneralResponsePage responsePageWithCurrentPage:1 perPage:20]
现在只显示20个用户列表
-(void)requestDialogsWithCompletionBlock:(void(^)())completionBlock{
self.getDialogsCompletionBlock = completionBlock;
[QBRequest dialogsWithSuccessBlock:^(QBResponse *response, NSArray *dialogObjects, NSSet *dialogsUsersIDs) {
self.dialogs = dialogObjects.mutableCopy;
[QBRequest usersWithIDs:[dialogsUsersIDs allObjects] page:nil
successBlock:^(QBResponse *response, QBGeneralResponsePage *page, NSArray *users) {
} errorBlock:nil];
} errorBlock:nil];
}