2015-01-11 2 views
0

한 번에 PFRelation에 질문 한 여러 사용자를 추가하고 싶습니다. 어떻게해야합니까? 또한 현재 사용자가 나중에 액세스 할 수 있도록 모든 사용자 정보가 PFRelation에 저장됩니까? 각 하나 myMatches 관계에 추가하여 self.myMatches 배열의 항목을 통해한 번에 여러 명의 사용자 추가하기 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; 
} 

답변

0

그냥 루프.

일단 작업이 완료되면 관계가 포함 된 상위 개체 (예 : [PFUser currentUser]) 만 저장하면됩니다.

+0

루프를 통해 무엇을 의미합니까? in 루프 또는 루프 표준 만? –

+0

그래, 사용자가 구문 분석에 성공적으로 저장되었지만 사용자 정보와 objectId를 제외하고 사용자 정보를 가져 와서 테이블보기로 표시하려고하면 작업이 제대로 이루어지지 않습니다. 위의 코드를 게시합니다. –

+0

알았어 그 오류를 발견. NSString을 NSString 값으로 전달하고 있기 때문에 오류가 발생했습니다 : P –

관련 문제