因未捕获的异常终止应用程序' UIViewControllerHierarchyInconsistency'

时间:2013-06-29 01:00:58

标签: iphone ios uiview exception-handling uiviewcontroller

最初在以前的iOS中编写了我的代码,只是升级到iOS 6.1只是为了收到以下错误。我是新手,请原谅我,如果这是一个基本问题,但我还没弄明白如何解决这个问题。如果这不能提供足够的图片,请告诉我要包含哪些代码,我很乐意发布它。完全错误:


2013-06-28 17:44:06.007 DrinkMixer[5747:907] *** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UITableView: 0x81f0a00; frame = (0 20; 320 460); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x723bac0>; layer = <CALayer: 0x723b480>; contentOffset: {0, 0}> is associated with <UIViewController: 0x723cb00>. Clear this association before associating this view with <MasterViewController: 0x7141860>.

1 个答案:

答案 0 :(得分:0)

当您在viewController的根目录中有多个UIView时会发生这种情况。将其他视图添加为主视图的子视图,错误将消失。