繁体   English   中英

iOS的LinkedIn API出现问题

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM