0
我想添加多個用戶,我一次查詢一個PFRelation。我該如何去做這件事。也將所有的用戶信息存儲在PFRelation中,以便當前用戶可以在以後訪問它?一次添加多個用戶到PFRelation IOS目標c
//so now i am finding users in the PFRelation, but I cannot use the Users information in a table. The code for the table view is at the bottom.
PFQuery * query =[self.matchesRelation query];
[query orderByDescending:@"Score"];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
self.myMatches =[objects mutableCopy];
[self.tableView reloadData];
}
}];
//code for the tableview, i can set the users username fine but anything else i cant
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString * CellIdentifier [email protected]"Cell";
customCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
self.person =[self.myMatches objectAtIndex:indexPath.row];
cell.name.text = self.person.username;
//this does not work, why ?
cell.score.text =[self.person objectForKey:@"Score"];
return cell;
}
你是什麼意思循環?對於循環或只是一個標準的循環? –
好了,所以用戶已經成功保存解析,但是,當我嘗試從用戶名和objectId中獲取用戶信息之外的任何信息並將其顯示在表視圖中時,它就可以工作。我將發佈上面的代碼。 –
它很好,我發現了錯誤。該錯誤是由於我傳遞一個NSNumber到一個NSString值:P –