I am currently working on an app that heavily relies on Core Data. I use a navigation controller to push and pop views around. When I go back in the stack in the navigation controller the program sometimes crashes and I receive the error (usually highlighted on a managedObjectContext synthesize or dealloc):
"Thread 1: Program received signal: "EXC_BAD_ACCESS".
I used the static analyzer to fix all the leaks it found.
I used NSZombie and it seems like my allocations go up, and then do not go down as I pull the menu views off. Then when I click on another menu view I get two results.
0 Category:NSManagedObjectContext EventType:Malloc RefCt:1 Timestamp:00:04.133.722 Address:0x5da0f10 Size:128 RespLib:pua-app RespCaller:-[pua_appAppDelegate managedObjectContext]
1 Category:NSManagedObjectContext EventType:Zombie RefCt:-1 Timestamp:00:16.524.983 Address:0x5da0f10 Size:0 RespLib:pua-app RespCaller:-[OpenersroutinesMenuViewController setManagedObjectContext]
I have ZERO experience with this type of debugging, but apparently the managed object context is 'unhappy' and my guess is that I am not properly creating or managing the context as it is passed through the menu. This is also interesting because the MOC is not being altered in these menus, and in the views where it is modified this error does not occur.