Exception 解除锁定后,iPhone4 EXC\u无法访问UIView。如何调试?

Exception 解除锁定后,iPhone4 EXC\u无法访问UIView。如何调试?,exception,uiview,ios4,uinavigationcontroller,iphone-4,Exception,Uiview,Ios4,Uinavigationcontroller,Iphone 4,我正在使用苹果的加速计图形示例: 我正在将两个图形视图推送到导航控制器上: GraphViewController* graphViewController = [[GraphViewController alloc]initWithNibName:@"GraphViewController" bundle:nil]; [self.navigationController pushViewController:graphViewController animated:YES];

我正在使用苹果的加速计图形示例:

我正在将两个图形视图推送到导航控制器上:

  GraphViewController* graphViewController = [[GraphViewController alloc]initWithNibName:@"GraphViewController" bundle:nil];

    [self.navigationController pushViewController:graphViewController animated:YES];
    [graphViewController release];
通过外部方法更新图形的:

     [motionManager startDeviceMotionUpdatesToQueue:motionQueue withHandler:^(CMDeviceMotion *motion, NSError *error) {
...

      if(graphDelegate)
                    {
                        [self performSelectorInBackground:@selector(notifyGraphDelegateWithMotionEvent:) withObject:motion];

                    }

}
,其中

 [unfiltered addX:filteredValue y:unfilteredvalue z:10]; 
对于每个图形。更新频率为每秒20次

当我从导航控制器弹出视图时,我在[super dealoc]之后获得EXC_BAD_访问权限

-(void)dealloc
{
    // Since 'text' and 'current' are weak references, we do not release them here.
    // [super dealloc] will take care to release 'text' as a subview, and releasing 'segments' will release 'current'.
    [segments release];
    [super dealloc];
}
这是一个严重的错误,我真的不知道如何解决类似的问题。这似乎与视图的取消分配顺序有关,因为崩溃发生在视图弹出后。有没有关于如何排除类似故障的想法?

集,以及在调试器中。然后,当应用程序崩溃时,在gdb控制台中键入以下内容:

(gdb) info malloc-history 0x543216
0x543216
替换为导致崩溃的对象的地址,您将获得一个更有用的堆栈跟踪,它将帮助您确定代码中导致问题的确切行


您是否在环境变量中尝试将NSZombieEnabled设置为YES?如果不是的话,那就先试试。尼基塔说的。您可能过度释放了一个对象,
NSZombie
就是用来检测的。@Alex Stone您给我们看的代码在我看来很好。修复EXC_坏访问很有趣。让我们知道启用NSZombieEnabled时会发生什么。如果这不起作用,你可以发布你的整个示例项目(压缩并在这里共享链接),有人会检查你的代码谢谢,下次我会尝试这种疯狂的bug潜入我的代码!