gpt4 book ai didi

objective-c - IOS FacebooSDK 3.0 模式 viewController 中的 FBLoginVIew

转载 作者:可可西里 更新时间:2023-11-01 03:29:42 26 4
gpt4 key购买 nike

我在 rightBarButtonItem 单击时显示了模态视图 Controller 。我在这个 Controller 中使用 FbLoginView,如示例 ios-Facebook SDK 3.0 Error 5 When Posting Status Update .

但是我无法多次显示模态视图 Controller 。 我试图在 ViewDidUnload 上释放 FBLoginView 但它总是在第二次尝试打开模态视图 Controller 时崩溃。

最佳答案

遇到同样的问题,已经处理了几天了。最后这是我的解决方案:

if (!FBSession.activeSession.isOpen) {
theLoginView = [[FBLoginView alloc] init];
theLoginView.frame = CGRectOffset(theLoginView.frame,
([[UIScreen mainScreen] bounds].size.width-theLoginView.frame.size.width)/2,
([[UIScreen mainScreen] bounds].size.height-theLoginView.frame.size.height)/2 -50);
theLoginView.delegate = self;
[self.view addSubview:theLoginView];
[theLoginView sizeToFit];
}
//Only close the session when application is terminating, this will save the token information:
- (void)applicationWillTerminate:(UIApplication *)application {
[FBSession.activeSession close];
}

//And keep the FBSession within the app until the user want to logout:
[FBSession.activeSession closeAndClearTokenInformation];

现在对我来说它工作得很好。希望对您有所帮助。

关于objective-c - IOS FacebooSDK 3.0 模式 viewController 中的 FBLoginVIew,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11977112/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com