Warning: Attempt to present A on B whose view is not in the window hierarchy!
2015-04-14 16:16
323 查看
UIViewController 显示的主页面 添加了一个scrollView
UICollectionViewController 自带collectionView
UITableViewController A自带 tableView
UITableViewController B 被present的界面
把collectionView,tableView 添加到scrollView上以显示滑动效果
问题,从UICollectionViewController 的cell选中present(模态)到UITableViewController 时,出现错误,显示如下:
Warning: Attempt to present A on B whose view is not in the window hierarchy!
查资料后说是视图混乱
需改如下
在UIViewController的scrollView添加view时,给controller加上两个子类controller 分别为这两个view
// 给view加上子类的controller
改后运行,有效果,但输出台显示如下,
Presenting view controllers on detached view controllers is discouraged <AttentionController: 0x7ff9d40376c0>.
此时应该回到被选中的cell时,添加父controll
[self.parentViewController presentViewController:listVC animated:YES completion:nil];
UICollectionViewController 自带collectionView
UITableViewController A自带 tableView
UITableViewController B 被present的界面
把collectionView,tableView 添加到scrollView上以显示滑动效果
问题,从UICollectionViewController 的cell选中present(模态)到UITableViewController 时,出现错误,显示如下:
Warning: Attempt to present A on B whose view is not in the window hierarchy!
查资料后说是视图混乱
需改如下
在UIViewController的scrollView添加view时,给controller加上两个子类controller 分别为这两个view
// 给view加上子类的controller
[self addChildViewController:_attention]; [self addChildViewController:_allControll];
<img src="http://img.blog.csdn.net/20150414164759227?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdTAxMDA3MDUyNg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" />
改后运行,有效果,但输出台显示如下,
Presenting view controllers on detached view controllers is discouraged <AttentionController: 0x7ff9d40376c0>.
此时应该回到被选中的cell时,添加父controll
[self.parentViewController presentViewController:listVC animated:YES completion:nil];
相关文章推荐
- iOS - 报错 Warning: Attempt to present <xx: xx> on <xx: xx> whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present BBBViewController on AAAViewController whose view is not in the window hierarchy!
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present on whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- 对Warning: Attempt to present XXX on XXX whose view is not in the window hierarchy!的解决方案
- Warning: Attempt to present A on B whose view is not in the window hierarchy!
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- 对Warning: Attempt to present on whose view is not in the window hierarchy!的解决方案
- Attempt to present on whose view is not in the window hierarchy!
- 处理iOS报错: Warning “attempt to present ViewController whose view is not in the window hierarchy”
- swift一次 Attempt to present on whose view is not in the window hierarchy的解决方法
- swift一次 Attempt to present on whose view is not in the window hierarchy的解决方法
- Attempt to present XX on XX whose view is not in the window hierarchy
- Attempt to present on whose view is not in the window hierarchy!
- Warning: Attempt to present ControllerA and ControllerB whose view is not in the window hierarchy!
- iOS 简单的实现手机号正误的判断(Warning: Attempt to present... whose view is not in the window hierarchy!