Facebook iOS SDK在App Start上挂起

时间:2014-05-27 06:13:38

标签: ios iphone facebook-ios-sdk

我还没有在appDidFinishLoadingWithOptions中启动任何facebook视图或方法:但是当我首先启动app时,然后停止并重新启动它,它会挂起。如果我按下暂停按钮,我可以看到图像中显示的堆栈轨迹。

Stack Trace Image

方法 applicationDidBecomeActive 中的此代码正在创建此问题。任何人都知道可能的原因是什么。删除它解决了我的问题。

- (void)applicationDidBecomeActive:(UIApplication *)application {

if (FBSession.activeSession.state == FBSessionStateCreatedOpening) {
[FBSession.activeSession close]; // so we close our session and start over
}

if (FBSession.activeSession.isOpen) {
}

}

1 个答案:

答案 0 :(得分:0)

实际上你必须将页面导航到另一个视图控制器,所以试试这个。

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

{

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];

UIViewController *splashController = [[UIViewController alloc]init];
UINavigationController *detailednewscontroller=[[UINavigationController alloc]initWithRootViewController:splashController];
[self.window setRootViewController:detailednewscontroller];
[self.window makeKeyAndVisible];
return YES;
}