English 中文(简体)
应用程序因导航到不同视图而崩溃
原标题:application crash due to navigate to different views
  • 时间:2012-05-23 09:42:28
  •  标签:
  • iphone
  • ios

当我浏览到不同视图超过10至11次时, 我的应用程序崩溃。 我是指在主屏幕上有6个按钮, 用来按下这些按钮, 让你看到不同的观点。 当我反复按下这些按钮时, 我的应用程序崩溃了。 我花了3天时间, 但没有解答 。 这是应用程序崩溃的代码 。

当I uncomment 发布声明 然后它崩溃了 第一次。

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

when i uncomment then i console error is "wait_fences: failed to receive reply: 10004003 [Switching to process 2093] [Switching to process 2093] Program received signal: “EXC_BAD_ACCESS”." -(IBAction)goToPhotos{ picturesGallery *showPictures=[[picturesGallery alloc] initWithNibName:@"picturesGallery" bundle:nil]; [self.navigationController pushViewController:showPictures animated:YES]; //[showPictures release]; }

最佳回答

您是否使用过 ARC? 如果不是, 根据您的代码, 您的代码中有一些内存泄漏, 请试一下 :

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

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


根据您的崩溃日志, EXC_BAD_ACCESS 表示存在一些内存泄漏。 在 Xcode 中启用 NSZombie 以调试 。 在 Xcode 4.3 中, 转到 production- gt; Edit schep- gt; 诊断性 , 检查 Enable Zombie 对象

问题回答

暂无回答




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签