如果没有登录帐户,我正在尝试加载 viewController 但是它给了我这个错误Warning: Attempt to present <DefaultViewController: 0xb96cac0> on <MainViewController: 0xb95c320> whose view is not in the window hierarchy!
这是我现在正在使用的代码:
BOOL returnAllOff = [[User data] returnAllOff];
if (returnAllOff) {
DefaultViewController *viewController =[[DefaultViewController alloc]
init];
UIViewController *presentingController = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
[presentingController presentViewController:viewController animated:YES completion:nil];
}