IOS FBSession无法分配原因?

时间:2014-05-25 08:43:53

标签: ios facebook login

我想让Facebook登录" iOS中的功能。问题是[FBSession alloc]无效。

[FBSession alloc]0X0000000

所以[[FBSession alloc] init]崩溃了。为什么[FBSession alloc]0X00000

代码:

- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.

[self updateView];

SLAppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];
if (!appDelegate.session.isOpen) {
    // create a fresh session object
    appDelegate.session = [**[FBSession alloc]** init];

    if (appDelegate.session.state == FBSessionStateCreatedTokenLoaded) {
        // even though we had a cached token, we need to login to make the session usable
        [appDelegate.session openWithCompletionHandler:^(FBSession *session,
                                                         FBSessionState status,
                                                         NSError *error) {
            // we recurse here, in order to update buttons and labels
            [self updateView];
        }];
    }
}

}

0 个答案:

没有答案