通过linkedin的OAuth登录后,我试图呈现一个新的视图控制器。但是我收到了这个错误。
2013-05-27 20:24:23.530 SessionLoginSample[26016:c07] 警告:尝试呈现不在窗口层次结构中的视图!2013-05-27 20:24:23.531 SessionLoginSample[26016:c07] 是
这是我正在使用的代码,任何解决此问题的提示将不胜感激。
- (IBAction)button_TouchUp:(UIButton *)sender
{
oAuthLoginView = [[OAuthLoginView alloc] initWithNibName:nil bundle:nil];
// register to be told when the login is finished
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(loginViewDidFinish:)
name:@"loginViewDidFinish"
object:oAuthLoginView];
[self presentModalViewController:oAuthLoginView animated:YES];
}
-(void) loginViewDidFinish:(NSNotification*)notification
{
ViewController *NVC = [self.storyboard instantiateViewControllerWithIdentifier:@"NextViewViewController"];
[self presentViewController:NVC animated:YES completion:nil];
NSLog(@"YES");
}