tags:

views:

99

answers:

3

Everytime I quit the app in the simulator. The console display this error message:

* -[NSThread _nq:]: message sent to deallocated instance 0x6d770e0

Looks the app try to access an deallocated instance. But I cannot find it anyhow, even using the instrument.

I can't find the line of code that cause the problem.

p.s. I have already tried any ways that I know to debug this problem. but no success yet. I enabled NSZombie and use instrument to help me to find out the error. But the error report did not point to any of my own code. I have no idea why this happen.

+2  A: 

Double click on your executable in the left pane in XCode, go to the arguments tab, add a new one named NSZombiesEnabled and set its value to YES. This will set all deallocated instance to an NSZombie and you'll be able to tell what type is being deallocated.

NOTE: THis must be turned off after or your app will never release memory!

cory.m.smith
I have enabled it already..
Mak Sing
A: 

Mak, Did you ever fix this? I have the same problem.

Michiel
Fixed, this problem is that I access interface objects not in the main thread. you can do so by [self performSelectorOnMainThread....].
Mak Sing
Interface objects must be access on main thread in iOS 4.0
Mak Sing
Thanks. Even creating a view in the background thread and adding this view later on to the viewcontroller with performSelectorOnMainThread will cause this error.
Michiel
A: 

Fixed, this problem is that I access interface objects not in the main thread. you can do so by [self performSelectorOnMainThread....].

Mak Sing