IOS 开发中 Whose view is not in the window hierarchy 错误的解决办法
来源:互联网 发布:pdf 编辑器 for mac版 编辑:程序博客网 时间:2024/05/21 05:05
在 一个 ViewController 里面调用另外一个 ViewController 是出现这个错误:该错误一般是由于在 viewDidLoad 里面调用引起的,解决办法是转移到 viewDidAppear 方法里面
在 AppDelegate.m 中调用遇到这个错误
解决办法1:
CameraViewController *camera = [[CameraViewController alloc] init]; MainNavigationController *nav = [[MainNavigationController alloc] initWithRootViewController:camera]; camera.editImage.image = image; AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; [delegate.window.rootViewController presentViewController:nav animated:YES completion:nil];
解决办法2:
UIStoryboard *mainstoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil]; LoginViewController* loginViewController = [mainstoryboard instantiateViewControllerWithIdentifier:@"LoginViewController"]; [self.window makeKeyAndVisible];//[LoginViewController presentViewController:yourController animated:YES completion:nil];//or[LoginViewController myMethod];
参考地址:http://stackoverflow.com/questions/11862883/whose-view-is-not-in-the-window-hierarchy
0 0
- IOS 开发中 Whose view is not in the window hierarchy 错误的解决办法
- IOS 开发中 Whose view is not in the window hierarchy 错误的解决办法
- iOS 开发中 Whose view is not in the window hierarchy 错误的解决办法
- IOS 开发中 Whose view is not in the window hierarchy 错误的解决办法
- [IOS开发记录]Whose view is not in the window hierarchy 错误的解决办法
- iOS Whose view is not in the window hierarchy 错误的解决办法
- 获取rootviewcontroller Whose view is not in the window hierarchy 错误的解决办法
- iOS开发出错whose view is not in the window hierarchy!的解决
- ios开发异常:whose view is not in the window hierarchy! (20
- iOS开发异常warning:***whose view is not in the window hierarchy!
- [ios开发异常]whose view is not in the window hierarchy!
- whose view is not in the window hierarchy!
- whose view is not in the window hierarchy!
- whose view is not in the window hierarchy
- whose view is not in the window hierarchy
- whose view is not in the window hierarchy
- whose view is not in the window hierarchy
- whose view is not in the window hierarchy!
- js模拟网页进度加载。
- 指针的概念及避免野指针
- Linux系统分区原理
- 分清matlab与VS的快捷键
- NYOJ1170最大数
- IOS 开发中 Whose view is not in the window hierarchy 错误的解决办法
- 几大图片加载框架比较
- Intent介绍及Intent在Activity中的使用方法
- 完全解决UIButton的imageEdgeInsets
- JAVA的异常处理
- php 过滤特殊字符函数
- 前端图片压缩 pngquanty
- GridView的使用
- spring mvc 传递数组对象