FBFriendPickerViewController在FB-IOS SDK3.0中崩溃

我在IOS上的Facebook SDK3.0上工作,我使用developers.facebook.com生成Facebook密钥

my App ID/API Key 165158463618789 

login工作正常,但同时使用FBFriendPickerViewController它崩溃,

我用下面的代码:

  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长度]:无法识别的select发送到实例0x3024d0 2012-08-07 11:13:12.430 IndusPatient [784:707] *终止应用程序由于未捕获的exception'NSInvalidArgumentException',原因:' – [__ NSCFDictionary长度]:无法识别的select器发送到实例0x3024d0 *第一次调用堆栈:(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调用抛出exception

我也面临这个问题,但现在我已经解决了这个问题。

使用下面的方法/代码,我解决了问题

在AppDelegate中

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

添加这一行

 [FBFriendPickerViewController class]; 

在你的viewController头文件中添加

 @property (retain, nonatomic) FBFriendPickerViewController *friendPickerController; 

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

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

所以我没有使用导航控制器风格编程。