线程1:EXC_BAD_ACCESS(代码= 1,地址= 0x30000008) [英] Thread 1 : EXC_BAD_ACCESS (Code = 1, address = 0x30000008)

查看:110
本文介绍了线程1:EXC_BAD_ACCESS(代码= 1,地址= 0x30000008)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然坚持这个问题,甚至按照这个论坛的所有答案。任何人都可以用简单的方式告诉我该怎么做?我是xcode的新学习者。我启用了僵尸对象。

I still stuck on this problem even followed all the answer from this forum. can anyone tell me what to do in simple way? I'm new learner in xcode. I have enable the zombie object.

这是我的编码崩溃

if ([[[AryStoreknowItem objectAtIndex:indexPath.row] objectForKey:@"action"] isEqualToString:@"a1"]) {

    NSString *t1 =[[AryStoreknowItem objectAtIndex:indexPath.row] objectForKey:@"title"];

    NSString *a1 = [[AryStoreknowItem objectAtIndex:indexPath.row] objectForKey:@"action"];

    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

    // saving an NSString
      [defaults setObject:a1 forKey:@"a1"];
      [defaults setObject:t1 forKey:@"t1"];

    JournalPage *journal=[[JournalPage alloc]initWithNibName:@"JournalPage" bundle:nil];

    [self presentModalViewController:journal animated:YES];

在我的应用程序中,我有多个ViewController。当我点击UINavigationBar的后退按钮然后生成这种类型的问题时,我无法解释我的问题,因为所有功能都正常工作。

In my Application, I have multiple ViewController. when i click on back button of UINavigationBar then this type of issue generated , i can't explain my problem because all the functionality work proper.

示例: -

1 - fitstVController(正常工作)

1 - fitstVController (work properly)

=>它有UITableView,当我点击特定行时它会是继续使用另一个UIViewController(SecoundViewController)

=> it have UITableView , when i click on specific row then it will be go on another UIViewController (SecoundViewController)

2 - SecoundViewController(正常工作)

2 - SecoundViewController (work properly)

=>它有UITableView和UIActionSheet。当我选择UiActionSheet的按钮然后另一个UIViewController(ThirdViewController)打开

=> it have UITableView and UIActionSheet. when i select button of UiActionSheet then another UIViewController (ThirdViewController) is open

3 - ThirdViewController(无法打开)

3 - ThirdViewController (cannot open)

=>当我点击第三行时出现错误。同样如果我点击其他单元格,我点击的第三个单元格会在转到其他页面之前崩溃

=> error came when i click on row three. same goes if i click on other cell, the third cell that i click will got crash before in goes to other pages

推荐答案

我我认为我们没有足够的诊断任何特定的问题(并且很难按照你的描述)。尽管如此,我建议:

I don't think we've got enough here to diagnose any particular problem (and it's hard to follow your description). Nonetheless, I would recommend:


  1. 我建议通过静态分析器运行代码(XcodeProduct上的Analyze菜单)并确保不提供任何警告。这将(除其他外)识别许多常见的内存问题,这些问题很容易困扰非ARC代码。在这里得到一份健康的健康状况之前,没有必要再进一步了。

  1. I would suggest running your code through static analyzer ("Analyze" on the Xcode "Product" menu) and making sure that doesn't provide any warnings. That will (amongst other things) identify many routine memory issues that can easily plague non-ARC code. There's no point in going further until you get a clean bill of health here.

我建议打开异常断点并查看是否标识了作为问题根源的特定代码行。有时,这可以识别代码行,而无需通过查看堆栈跟踪来反向设计发生错误的位置。

I would suggest turning on the Exception Breakpoint and see if that identifies a particular line of code that is the source of the issue. Sometimes that can identify the line of code without having to reverse engineer where the error occurred by looking at the stack trace.

鉴于您正在执行非ARC代码,您可能还想暂时打开僵尸。您可以在计划配置中看到此设置设置。

Given that you're doing non-ARC code, you might also want to temporarily turn on zombies. You can see this setting the the Scheme Configuration settings.

除此之外,我会把你推荐给Ray Wenderlich的文章我的应用程序崩溃,现在是什么?

Beyond that, I'd refer you to Ray Wenderlich article My App Crashed, Now What?.

如果您仍然有错误,请与我们分享堆栈跟踪。

If you continue to have errors, share the stack trace with us.

这篇关于线程1:EXC_BAD_ACCESS(代码= 1,地址= 0x30000008)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆