如何将数组发送到用户可以select好友并发布到他们的Facebook墙上的表格
我使用下面的代码来调用Facebook的请求方法,请求调用委托方法返回一个NSDictionary对象与标签为'数据'的键。 然后我通过调用NSArray * data = [result objectForKey:@“data”]来获取好友数组;
然后代码遍历该数组并提取输出到控制台的名称。
我遇到的问题是如何将这个数组发送到一个表,用户可以select一个朋友并张贴到他们的FB墙。
谢谢你的帮助 :)
AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; [[delegate facebook] requestWithGraphPath:@"me/friends" andDelegate:self]; // get the array of friends NSArray *data = [result objectForKey:@"data"]; NSMutableArray *array = [NSMutableArray array]; for (int i = 0; i < data.count; i++){ id object = [data objectAtIndex:i]; [array addObject:[object objectForKey:@"name"]]; } // output the array of friends NSLog(@"list of friends %@", array);
我想我需要的东西像(我不知道该把objectAtIndex:?????部分:
[self apiDialogFeedFriend:[[data objectAtIndex:**?????**] objectForKey:@"id"]];
接着
[self apiGraphFriends];
得到Facebook好友的照片和名字。 在arrays中的Stroe
FBRequest* friendsRequest = [FBRequest requestForMyFriends]; [friendsRequest startWithCompletionHandler: ^(FBRequestConnection *connection, NSDictionary* result, NSError *error) { friends = [result objectForKey:@"data"]; arr_FaceBookFriendProfileImg = [[NSMutableArray alloc] init]; arr_FaceBookFriendName = [[NSMutableArray alloc]init]; for (NSDictionary<FBGraphUser>* friend in friends) { NSString *str_FacebookFriendNames; str_FacebookFriendNames = friend.name; NSString *userPhotoUrl = [NSString stringWithFormat:@"https://graph.facebook.com/%@/picture?", friend.id]; NSURL *url_FriendProfileImage = [NSURL URLWithString:userPhotoUrl]; [arr_FaceBookFriendName addObject:str_FacebookFriendNames]; [arr_FaceBookFriendProfileImg addObject:url_FriendProfileImage]; } // [table_facebookFriends reloadData]; }];
并显示TableView
cell.lbl_FriendsProfileName.text = [arr_FaceBookFriendName objectAtIndex:indexPath.row];
- Facebook的。 如何获取我的应用程序的所有用户列表?
- 安全警告:“请按照您的密码处理上面的URL,不要与任何人分享
- 这是iOS的WebView用户代理的Facebook吗?
- 强制iOS Facebook应用程序在浏览器中打开馈送链接,而不是在WebView中
- iOS上的Facebook SDK 4.6loginbutton不使用Facebook应用程序进行身份validation
- iPhone应用程序拒绝17.2:应用程序要求用户使用其Facebook帐户login
- Twitter图标在设备上的iOS 7中的UIActivityViewController中不显示
- Facebook的iOS SDK的戳
- Facebook SDK Singleton在xcode之前自动login后?