【发布时间】:2011-05-22 17:45:08
【问题描述】:
嗨 当我从一种视图切换到另一种视图时,我会这样做:
-(void)goInGame {
InGameViewController = [[InGameView alloc] initWithNibName:@"InGameView" bundle:nil];
[self presentModalViewController:self.InGameViewController animated:NO];
[InGameViewController release];
}
但是这种方式InGameViewController的retain count是“0”,但是InGameView的retain count是“-1”,有时会崩溃
错误: 将应用程序终止为两个未捕获的异常'NSInternalInconsistencyException',原因:'无法加载捆绑包NIB:'NSBundle <.... app>(已加载)'名称为'InGameView''
我哪里错了?
谢谢!
【问题讨论】:
-
NIB 文件似乎有问题。你检查过吗?
InGameViewController是retain-ed 属性吗? -
不要调用 retainCount。没用。
-
你有没有想过这个问题?
标签: objective-c xcode uiviewcontroller