我有一个完美的工作项目,直到我更新到ios6。UIViewControllerHierarchyInconsistency在ios5中工作,但不在ios6中
当我在一个酒吧项目标签,以显示与视图中的应用程序崩溃一酥料饼...
以下是错误我得到
"reason: 'A view can only be associated with at most one view controller at a time! View <UIView: 0xaa7d730; frame = (20 0; 748 1024); autoresize = RM+BM; layer = <CALayer: 0xaa7d790>> is associated with <TYOFormViewController: 0xaa7d8b0>. Clear this association before associating this view with <TYOFormViewController: 0x14c68a70>.'"
,这里是声明的方法UIViewController和UIPopoverController。
- (IBAction)TestDriveTapped:(id)sender{
if (PopoverController != nil) {
[PopoverController dismissPopoverAnimated:YES];
self.PopoverController = nil;
}
if (self.PopoverController == nil) {
UIViewController *bookTestDrive =[[TYOFormViewController alloc] initWithNibName:@"TYOBookTestDriveForm" bundle:nil];
UIPopoverController *poc = [[UIPopoverController alloc]
initWithContentViewController:bookTestDrive];
[poc presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
self.PopoverController = poc;
} else {
if (PopoverController != nil) {
[PopoverController dismissPopoverAnimated:YES];
self.PopoverController = nil;
}
}
}
错误说我必须清除与TYOFormViewController联想到它与TYOFormViewController关联....这是怎么回事???
很想这个问题你的帮助...... jstuck整天吧..
感谢
我刚刚得到了同样的错误。我将其缩小到我的从UIView到EAGLView(EAGLView * eagl =(EAGLView *)self.view)的阵容。我仍然不确定是什么原因造成了这个...... – Diamondo25
我认为这个问题与UIPopoverController有关......但是当我试图用UIViewController BookTestDrive做任何动作时,断点就停在这些动作上....一些错误。 ..并且我不知道它是什么 – hsn
升级到ios 6后,对我来说同样的错误。'UIViewControllerHierarchyInconsistency',原因:'一个视图最多只能与一个视图控制器关联!查看>与关联。在将此视图与关联之前清除此关联。 –