[英]LinkedIn API getting issue for iOS
我使用以下鏈接將LinkedIn API集成到我的應用程序中
https://github.com/jeyben/IOSLinkedInAPI
當我將該api集成到我的應用程序中時,它的首次登錄效果非常好。 之后,由於LinkedIn API類出現以下問題,並且由於以下錯誤而導致永遠無法打開Linkedin登錄視圖
- (void)showAuthorizationView:(LIALinkedInAuthorizationViewController *)authorizationViewController {
if (self.presentingViewController == nil)
self.presentingViewController = [[UIApplication sharedApplication] keyWindow].rootViewController;
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:authorizationViewController];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
nc.modalPresentationStyle = UIModalPresentationFormSheet;
}
[self.presentingViewController presentViewController:nc animated:YES completion:nil];
}
問題在
[self.presentingViewController presentViewController:nc animated:YES completion:nil];
錯誤是
Warning: Attempt to present <UINavigationController: 0x787db610> on <myViewController: 0x78677de0> whose view is not in the window hierarchy!**
非常奇怪,我檢查了一些論壇在viewDidAppear
建議的運行代碼,但是在我的情況下,我無法在viewDidAppear
運行此代碼,因為它不是我的自定義類。 能否請任何人建議我如何避免這個問題? 由於此問題,當我單擊LinkedIn登錄按鈕時,沒有出現Loginview,並且我正在使用XCode6
。 提前致謝!
[self.presentingViewController presentViewController:nc animated:YES completion:nil];
這表示您正在嘗試通過presentingViewController呈現nc。 但是這里的問題是您的presentingViewcontroller
不在視圖層次結構中(即, presentingViewcontroller
存在的實例既未呈現也不被推送(根本不在視圖中))
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.