亲爱的所有人,我有一个基于导航的应用程序,大约有60个UIControllerViews,分为4个部分。由于内存不足导致iPhone应用程序崩溃,但在模拟器中正常工作
我用以下方法运行:1.构建和分析:bulid成功,没有抱怨。 2.仪器分配和泄漏:无泄漏。
但是,该应用程序在iPhone或iPad坠毁,但在模拟器中工作正常。没有崩溃报告,但我在crashreporter文件夹中看到LowMemory.log。
我已经升级我的iPhone和iPad,以4.2
任何人都不会有想法可能是错了吗?我一直在阅读和排除故障。
是否需要删除/释放UIControllerViews? 该应用程序简单地通过在视图之间导航来崩溃。
谢谢你的帮助。
我的应用程序有一个名为contentViewController的根视图,用户可以从这里导航到4个测验。
这是我用来返回到我的根视图的代码。
- (void)goHome {
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Warning"
message: @"Proceed?"
delegate: self
cancelButtonTitle:@"Yes"
otherButtonTitles:@"No",nil];
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
[[self navigationController] setNavigationBarHidden:NO animated:YES];
if (buttonIndex == 0) {
NSArray * subviews = [self.view subviews];
[subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
self.view = nil;
if (self.contentViewController == nil)
{
ContentViewController *aViewController = [[ContentViewController alloc]
initWithNibName:@"ContentViewController" bundle:[NSBundle mainBundle]];
self.contentViewController = aViewController;
[aViewController release];
}
[self.navigationController pushViewController:self.contentViewController animated:YES];
}
else {
}
}
你是否推出推送后推送的视图控制器?如何推送视图控制器的代码示例将会很有帮助。 – 2010-11-26 00:20:01
它会在相同的地方或每次不同的地方崩溃吗?在设备上调试时会崩溃吗?或只有在运行分离时? – MCannon 2010-11-26 01:02:14