iOS获取Parse Facebook好友名字和分数

我从Parse获取Facebook朋友列表,并将其所有数据存储在任何Array中。 例如:

( "<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}" 

代码如下:

 [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]; } }]; 

所以,现在,从NSArray friendUsers我需要得到另一个数组像friendNames,它必须从关键“configuration文件”的关键是“名称”从friendUser获取信息。 我无法find如何写这个工作…另外,我将在TableView中使用的数组“friendNames”。

你不能这样做,检索并保存好友列表。 在这里阅读答案。 如何检索Facebook的朋友列表并保存它来parsing? 。 如果您也在其他应用程序中完成,build议您在2015年4月之前更改。