无法使用Storyboard加载FBFriendPickerViewController

时间:2013-12-06 07:18:55

标签: ios objective-c facebook

我正在使用Storyboard方法制作Scrumptous示例应用程序(ios facebook sdk version - 3.10)的副本


我能够正确加载用户名和个人资料图片。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Do nothing for now
switch (indexPath.row) {
    case 2:
        if (!self.friendPickerController) {

            self.friendPickerController = [[FBFriendPickerViewController alloc]
                                           initWithNibName:nil bundle:nil];



            // Set the friend picker delegate
            self.friendPickerController.delegate = self;

            self.friendPickerController.title = @"Select friends";
        }

        [self.friendPickerController loadData];
        [self.navigationController pushViewController:self.friendPickerController
                                             animated:true];
        break;
}

}

通过以下方法,我们可以实例化ViewController,但我们需要一个有效的标识符

         /*

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"myViewController"];
[self presentViewController:vc animated:YES completion:NULL];

*/

0 个答案:

没有答案