我正在使用 sdk 3.1 并尝试使用friendpickercontroller,但不知何故表格在我的应用程序上加载为空。
这是我的代码,你能给出原因的提示吗?
谢谢
- (void) loadFacebookFriendsPicker:(UINavigationController *)senderNavigationController {
if (!FBSession.activeSession.isOpen) {
// if the session is closed, then we open it here, and establish a handler for state changes
[FBSession.activeSession openWithCompletionHandler:^(FBSession *session,
FBSessionState state,
NSError *error) {
switch (state) {
case FBSessionStateClosedLoginFailed:
{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
message:error.localizedDescription
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
break;
default:
break;
}
}];
}
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];
[senderNavigationController pushViewController:self.friendPickerController animated:YES];
}