2014-03-06 2 views
1

Parse에서 페이스 북 친구 목록을 모든 배열의 모든 데이터로 가져오고 있습니다. 예를 들어 :있는 ​​NSArray의 friendUsers에서 어디서 키 키 "프로필"을 friendUsers에서 정보를 얻을 수있다 friendNames 같은 다른 배열을 얻을 필요가, 그래서 지금iOS get Parse Facebook 친구 이름 및 점수

[FBRequestConnection startForMyFriendsWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) { 
    if (!error) { 
     // result will contain an array with your user's friends in the "data" key 
     NSArray *friendObjects = [result objectForKey:@"data"]; 
     NSMutableArray *friendIds = [NSMutableArray arrayWithCapacity:friendObjects.count]; 
     // Create a list of friends' Facebook IDs 
     for (NSDictionary *friendObject in friendObjects) { 
      [friendIds addObject:[friendObject objectForKey:@"id"]]; 
     } 

     // Construct a PFUser query that will find friends whose facebook ids 
     // are contained in the current user's friend list. 
     PFQuery *friendQuery = [PFUser query]; 
     [friendQuery whereKey:@"fbId" containedIn:friendIds]; 

     // findObjects will return a list of PFUsers that are friends 
     // with the current user 
     NSArray *friendUsers = [friendQuery findObjects]; 
     NSLog(@"Firends: %i", friendUsers.count); 
     NSLog(@"%@", friendUsers); 

     [[PFUser currentUser] saveInBackground]; 
    } 
}]; 

: 여기

(
"<PFUser:npzU2fuydD:(null)> { 
\n HS = 99; 
\n fbId = 1000000000000000; 
\n profile =  { 
\n  facebookId = 100000748420227; 
\n  name = \"Name Lastname"; 
\n  pictureURL = \"https://graph.facebook.com/100000000000000/picture?type=large&return_ssl_resources=1\"; 
\n }; 
\n username = k49vitcfqbb22p0pu40ejy6oh;\n}" 

코드입니다 이름이야". 이 일을 쓰는 방법을 찾을 수 없습니다 ... 또한 TableView에서 사용할 배열 "friendNames".

답변