views:

70

answers:

1

Hello stack overflow,

So I have a table view that contains a bunch of data. The user can navigate down, browse edit, etc. However when they edit and delete a row, and then navigate back via the nav controller, sometimes (not all the time) the app crashes throwing this error:

-[CALayer resourceType]: unrecognized selector sent to instance: **********

does anyone know what could be causing this error? I can't seem to isolate the cases where this happens, it seems random. The data for this is coming from an array. Not sure if that makes a difference. Thanks in advance!

+6  A: 

Must likely, you are over-releasing an object or releasing an object too soon (or not retaining an object).

Turn on zombie detection and try to reproduce the crash. (Instruments has a zombie detection mode or search Google for NSZombieEnabled).

bbum
http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/iphone_development/130-Debugging_Applications/debugging_applications.html
JeremyP
Yeah it's a problem with my NSDocumentController causing a memoryWarning which releases stuff that shouldn't be yet. (everything that I read online said it needs to be retained). I guess the question is now, when exactly should I be releasing the docCOntroller??
Geoff Baum
Figured it out. The zombie mode was really helpful. Thanks!
Geoff Baum