简体   繁体   English

iOS的LinkedIn API出现问题

[英]LinkedIn API getting issue for iOS

I integrated LinkedIn API into my app using following link 我使用以下链接将LinkedIn API集成到我的应用程序中

https://github.com/jeyben/IOSLinkedInAPI https://github.com/jeyben/IOSLinkedInAPI

First time its loggedin with pretty good when i was integrated that api into my app. 当我将该api集成到我的应用程序中时,它的首次登录效果非常好。 After that onwards getting issue as below from LinkedIn API class and its never opening Linkedin loginview due to error of below 之后,由于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];

}

issue is in 问题在

   [self.presentingViewController presentViewController:nc animated:YES completion:nil];

the error is 错误是

Warning: Attempt to present <UINavigationController: 0x787db610> on <myViewController: 0x78677de0> whose view is not in the window hierarchy!**

Its very strange, I checked some forums run code in viewDidAppear suggested, but in my case I could not run this in viewDidAppear because its not my custom class. 非常奇怪,我检查了一些论坛在viewDidAppear建议的运行代码,但是在我的情况下,我无法在viewDidAppear运行此代码,因为它不是我的自定义类。 Could please anyone suggest me how to avoid this issue? 能否请任何人建议我如何避免这个问题? Due to this issue, while I am clicking the LinkedIn login button the Loginview not appearing and I am using XCode6 . 由于此问题,当我单击LinkedIn登录按钮时,没有出现Loginview,并且我正在使用XCode6 Thanks in Advance! 提前致谢!

   [self.presentingViewController presentViewController:nc animated:YES completion:nil];

Which says you are trying to present your nc from presentingViewController. 这表示您正在尝试通过presentingViewController呈现nc。 But problem here is your presentingViewcontroller is not in view hierarchy(ie the instance that is there in the presentingViewcontroller is neither presented nor pushed (Not in view at all)) 但是这里的问题是您的presentingViewcontroller不在视图层次结构中(即, presentingViewcontroller存在的实例既未呈现也不被推送(根本不在视图中))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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