Search code examples
ios7xcode5uistoryboarduistoryboardsegue

Attempting to present <ViewController> on <UITabBarController> whose View is not in Window Hierarchy


Im trying to present a login screen from a TabBarController . But i get the following log message and the view controller is not navigating.

projectlogin[3372:60b] Warning: Attempt to present on whose view is not in the window hierarchy!

What i did was,ctrl+drag a segue to a viewcontroller(Login) and given identifier as viewcontroller (push).I make call from ViewDidLoad

[self  performSegueWithIdentifier:@"viewcontroller" sender:self];

I tried it it ViewWillAppear also,but no solution.


Solution

  • Call it from ViewDidAppear rather than ViewDidLoad or ViewWillAppear.