iphone - Presenting Modal View Keeps on Failing -


i keep getting warning , no matter try i'm not sure how resolve it.

attempt present <loginviewcontroller: 0x1f0b5010> on <viewcontroller: 0x1dda1670> view not in window hierarchy! 

i don't have segue in storyboard since, i'm calling modal view programmatically:

//load login view if no username found nslog(@"no username found"); uistoryboard *storyboard = [uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil]; loginviewcontroller *loginview = (loginviewcontroller *) [storyboard instantiateviewcontrollerwithidentifier:@"loginviewcontroller"]; [self presentviewcontroller:loginview animated:yes completion:nil]; 

here's image of storyboard:

enter image description here

thank you!!!

if trying present view in viewdidload, generate error.

if want use can use performselector , call code on delay.


Comments