大佬教程收集整理的这篇文章主要介绍了ios – 我在自定义表视图中有FB好友图片和名字.如何获取FB ID中的选定行并向多个朋友发送请求?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
NSMutableArray *arryOfFBIds; for (id<FBGraphUser> user in self.friendPickerController.SELEction) { NSMutableArray *SELEction=(NSMutableArray *) self.friendPickerController.SELEction; [SELEction addObject:user.id]; arryOfFBIds = [[NSMutableArray alloc] init]; for (id<FBGraphUser> user in self.friendPickerController.SELEction) { [arryOfFBIds addObject:user.id ]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject: arryOfFBIds forKey: @"SELEctedFBIds"]; [defaults synchronize]; NSLog(@"array of fb id:%@",arryOfFBIds); }} NSMutableDictionary* params2 = [NSMutableDictionary DictionaryWithObjectsAndKeys:@"Invite to on Ensmbl",@"description",@"http://placebogames.com/",@"link",// 3. Suggest friends the user may want to request,Could be game context specific? [arryOfFBIds componentsJoinedByString:@","],@"to",nil]; NSLog(@"qwer:%@",params2); [FBWebDialogs presentFeedDialogModallyWithSession:[FBSession activeSession] parameters:params2 handler:^(FBWebDialogResult result,NSURL *resultURL,NSError *error) { NSLog(@"error===>%@,resultURL===>%@",error,resultURL); } ]; }
简而言之,为了显示朋友的表格视图,FB iOS使用一个名为FPViewController的特殊自定义tableview控制器类,它继承自UIViewController但具有allowsMultipleSELEction属性,如果设置为TRUE,则允许您选择几个朋友,直到您按下完成按钮.
- (void)facebookViewControllerDoneWasPressed:(id)sender { NSMutableString *text = [[NSMutableString alloc] init]; // we pick up the users from the SELEction,and create a String that we use to update the text view // at the bottom of the display; note that self.SELEction is a property inherited from our base class for (id<FBGraphUser> user in self.friendPickerController.SELEction) { if ([text length]) { [text appendString:@","]; } [text appendString:user.name]; } [self fillTextBoxAndDismiss:text.length > 0 ? text : @"<None>"]; }
以上是大佬教程为你收集整理的ios – 我在自定义表视图中有FB好友图片和名字.如何获取FB ID中的选定行并向多个朋友发送请求?全部内容,希望文章能够帮你解决ios – 我在自定义表视图中有FB好友图片和名字.如何获取FB ID中的选定行并向多个朋友发送请求?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。