【发布时间】:2012-09-08 05:36:27
【问题描述】:
尝试使用以下代码呈现模态视图控制器
MapViewController *mapView = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil];
mapView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController presentModalViewController:mapView animated:YES];
[mapView release];
不断收到以下错误..
'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <UIView: 0x1ed815a0; frame = (0 20; 320 460); autoresize = W+H; layer = <CALayer: 0x1ed81600>> is associated with <UIViewController: 0x1ed835a0>. Clear this association before associating this view with <MapViewController: 0x1dd947c0>.'
这是一个我好几个月没碰过的老项目,不知道是什么导致了这样的错误?
【问题讨论】:
标签: ios objective-c xcode uiviewcontroller xib