我不断收到此警告,无论我尝试什么,我都不知道如何解决它。
Attempt to present <LoginViewController: 0x1f0b5010> on <ViewController: 0x1dda1670> whose view is not in the window hierarchy!
我的故事板中没有segue,因为我以编程方式调用模态视图:
//Load Login View if no username is 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];
这是我的故事板的图像:
谢谢!!!