开发者

ipad / iphone application EXC_BAD_ACCESS only in simulator, not on device

I was at client site today and made a couple of bug fixes there and then. I deployed the working copies of the app to their iPads and iPhone. Perfect. I have come home and now run the app in the 开发者_如何转开发Simulator.... but it crashes each time and I cannot figure out how. Unfortunately, I cannot see what I have changed which would cause this.

Does anyone know why you'd see the error message Program received signal: “EXC_BAD_ACCESS” on the simulator and not the iPad or iPhone?

I'm using Xcode 3.2.4 with OS4.1 on the iPhone 3GS and iPad 3.2.2 running on OSX 10.6.4

Thanks for any information. I'm tearing my hair out....!

[update]

here's the code where it's failing

- (void)dealloc
{
if (_node)
    {
    if (_node->_private == self) //THIS IS THE LINE that debug is stopping on
        _node->_private = NULL;
    _node = NULL;
    }
//
[super dealloc];
}


IS there any chance that this object isnt being retained properly? The Simulators memory is reused very quickly, thus if a pointer's retain count becomes 0, it will remap quickly and on the next access things can blow up.... reuse of memory in my experience is slower on the devices. Depending on the object;s type you can use CFGetRetainCount or [_node->_private retainCount];. If the object still breaks there isnt one.


That _node is used strangely. From your use of -> it appears to be a pointer. But you then set it to NULL. That's a very odd way to free a pointer or remove a reference to it.

Are you freeing the _node elsewhere? Maybe _node is being freed before this is called. That would give you a problem when you try to work with it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜