title: CoreData EXC_BAD_ACCESS, Could not access memory KERN_PROTECTION_FAILURE at address: 0x00000000
body: <p>I have a program using CoreData and a navigation controller.  If I add a entity that is connected to my main entity through a relationship than back out to the table view of all entries and the back into the same, recently edited, entry my program crashes.  My code is very similar, and for the CoreData part the same, to Apples sample code iPhoneCoreDataRecipes.</p>
  
  <p>The code will crash the first time I attempt to access the entity that I just changed with a "EXC_BAD_ACCESS".</p>
  
  <p>If I pause the program before that occurs and try and access my CoreData object I get the following in the console.</p>
  
  <p>Program received signal EXC_BAD_ACCESS, Could not access memory.
  Reason: KERN_INVALID_ADDRESS at address: 0xec0470f2
  0x937eeedb in objc_msgSend ()
  The program being debugged was signaled while in a function called from GDB.
  GDB has restored the context to what it was before the call.
  To change this behavior use "set unwindonsignal off"
  Evaluation of the expression containing the function (_NSPrintForDebugger) will be abandoned.</p>
  
  <pre><code> NSMutableArray *tempEventsArray = [[NSMutableArray alloc] initWithArray:[journalEntry.event allObjects]];
   self.eventsArray = tempEventsArray;
   [tempEventsArray release];
  </code></pre>
  
  <p>Apple's iPhoneCoreDataRecipes has the same problem so I will submit a bug report but did not know if I was missing some thing.  My iPone development target 3.1 and base SDK is also 3.1.</p>