1
我整合LinkedIn的API到我的應用程序使用下面的鏈接LinkedIn API獲取問題爲iOS
https://github.com/jeyben/IOSLinkedInAPI
第一次它的loggedIn具有相當不錯的,當我被整合該API到我的應用程序。這起正從LinkedIn API類,如下問題及其從來沒有打開LinkedIn loginview由於以下
- (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
。提前致謝!