0

当我导航到不同的视图超过 10 到 11 次时,我的应用程序崩溃了。我的意思是我在主屏幕上有 6 个按钮,按下它们会带您进入不同的视图。当我反复按下这些按钮时,我的应用程序崩溃了。我已经花了 3 天时间,但没有提出任何解决方案。这是应用程序崩溃的代码

当我取消注释发布声明时,它会在第一次后崩溃。

-(IBAction) goToLiveAlerts{
    teamAlerts *showLiveAlerts=[[teamAlerts alloc] initWithNibName:@"teamAlerts" bundle:nil];
    [self.navigationController pushViewController:showLiveAlerts animated:YES];
        //[showLiveAlerts release];
}

当我取消注释时,我的控制台错误是“wait_fences:未能收到回复:10004003 [切换到进程 2093] [切换到进程 2093] 程序收到信号:“EXC_BAD_ACCESS”。-(IBAction)goToPhotos{ picturesGallery *showPictures=[[picturesGallery alloc] initWithNibName:@"picturesGallery" bundle:nil]; [self.navigationController pushViewController:showPictures animated:YES]; //[显示图片发布]; }

4

1 回答 1

0

您是否使用ARC?如果不是,根据您的代码,您的代码中存在一些内存泄漏,请尝试以下操作:

-(IBAction)goToPhotos{
    picturesGallery *showPictures=[[picturesGallery alloc] initWithNibName:@"picturesGallery" bundle:nil];
    [self.navigationController pushViewController:showPictures animated:YES];
    [showPictures release];
}

无论如何,您需要提供更多的代码崩溃日志。


根据您的崩溃日志,EXC_BAD_ACCESS意味着存在一些内存泄漏。NSZombie在 Xcode 中启用以进行调试。在 Xcode 4.3 中,转到Product->Edit Scheme->Diagnostics并检查Enable Zombie Objects.

于 2012-05-23T10:48:01.260 回答