FBFriendPickerViewController在FB-IOS SDK3.0中崩溃 [英] FBFriendPickerViewController crashing in FB-IOS SDK3.0

查看:39
本文介绍了FBFriendPickerViewController在FB-IOS SDK3.0中崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在IOS上使用Facebook SDK3.0,我使用 developers.facebook.com

i am working on Facebook SDK3.0 on IOS, i generated Facebook key using developers.facebook.com

my App ID/API Key 
165158463618789

登录工作正常,但是在使用 FBFriendPickerViewController 时会崩溃,

Login works fine but while using FBFriendPickerViewController its getting crashing,

我使用了以下代码:

   FBFriendPickerViewController *friendPicker = [[FBFriendPickerViewController alloc]     init];
   self.friendPickerController = friendPicker;

   [friendPicker loadData];
   friendPicker.navigationItem.title = @"Pick Friends";
   friendPicker.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] 
                                                  initWithTitle:@"Done" 
                                                  style:UIBarButtonItemStyleBordered 
                                                  target:self 
                                                                 action:@selector(doneButtonWasPressed:)];
    friendPicker.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] 
                                                 initWithTitle:@"Cancel" 
                                                 style:UIBarButtonItemStyleBordered 
                                                 target:self 
                                                 action:@selector(cancelButtonWasPressed:)];
 [self.navigationController pushViewController:friendPicker animated:YES];

我正在崩溃的原因

-[__ NSCFDictionary length]:无法识别的选择器已发送到实例0x3024d02012-08-07 11:13:12.430 IndusPatient [784:707] *由于未捕获的异常'NSInvalidArgumentException'终止了应用程序,原因:'-[__ NSCFDictionary length]:无法识别的选择器发送到实例0x3024d0'* 第一个调用堆栈:(0x321a888f 0x341fe259 0x321aba9b 0x321aa915 0x32105650 0x320f1f19 0x3210e2cd 0x3210d1ad 0x3210e279 0x37a73fb1 0x37a73e8b0x1a9735 0x1a9bbf 0x31c2fefb 0x31c2efd9 0x31c2e763 0x31bd2f37
0x321071fb 0x33e6baa5 0x33e6b6bd 0x33e6f843 0x33e6f57f 0x33e674b90x3217cb1b 0x3217ad57 0x3217b0b1 0x320fe4a5 0x320fe36d 0x312554390x31bfdcd5 0xcdd2b 0xcdccc)终止称为引发异常

-[__NSCFDictionary length]: unrecognized selector sent to instance 0x3024d0 2012-08-07 11:13:12.430 IndusPatient[784:707] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary length]: unrecognized selector sent to instance 0x3024d0' * First throw call stack: (0x321a888f 0x341fe259 0x321aba9b 0x321aa915 0x32105650 0x320f1f19 0x3210e2cd 0x3210d1ad 0x3210e279 0x37a73fb1 0x37a73e8b 0x1a9735 0x1a9bbf 0x31c2fefb 0x31c2efd9 0x31c2e763 0x31bd2f37
0x321071fb 0x33e6baa5 0x33e6b6bd 0x33e6f843 0x33e6f57f 0x33e674b9 0x3217cb1b 0x3217ad57 0x3217b0b1 0x320fe4a5 0x320fe36d 0x31255439 0x31bfdcd5 0xcdd2b 0xcdccc) terminate called throwing an exception

推荐答案

我也遇到了这个问题,但现在我已经解决了.

i was also facing this problem but now i have resolved it.

在AppDelegate中

In AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

添加此行

[FBFriendPickerViewController class];

在您的viewController头文件中添加

In your viewController header file add

@property (retain, nonatomic) FBFriendPickerViewController *friendPickerController;

在您的viewController实现文件中添加一个函数

In your viewController implementation file add in a function

if (self.friendPickerController == nil) {
    // Create friend picker, and get data loaded into it.
    self.friendPickerController = [[FBFriendPickerViewController alloc] init];
    self.friendPickerController.title = @"Pick Friends";
    self.friendPickerController.delegate = self;
}

[self.friendPickerController loadData];
[self.friendPickerController clearSelection];

[self presentModalViewController:self.friendPickerController animated:YES];

所以我没有使用导航控制器样式编程.

so i have not used navigation controller style programming.

这篇关于FBFriendPickerViewController在FB-IOS SDK3.0中崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆