exec_bad_access while accessing NSArray returned from FetchRequest
<p>I have been trying hard to figure whats going wrong the the code below.
I find this code working when app is running for the first time in the simulator.
but when I close the simulator, open it next time and try deleting a record, that time i get exec_bad_access error.</p>

<pre><code>    NSFetchRequest *requestToDelete = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Recipe" inManagedObjectContext:managedObjectContext];
[requestToDelete setEntity:entity];

NSPredicate *predicateWithTitle = [NSPredicate predicateWithFormat:@"RecipeId == %@", strRecipeId];
[requestToDelete setPredicate:predicateWithTitle];

NSError *errorInRequest = nil;
NSArray *results = [managedObjectContext executeFetchRequest:requestToDelete error:&amp;errorInRequest];
[requestToDelete release];

if(errorInRequest!=nil )
{
    NSLog(@"Unresolved error %@, %@", errorInRequest, [errorInRequest userInfo]);
    abort();
}

if(results!=nil &amp;&amp; [results count] &gt; 0)
{
    [managedObjectContext deleteObject:[results objectAtIndex:0]];
            // Failing at this line
            // To be specific, this is causing error : [results objectAtIndex:0]
            // more strange part is, [results count] is 1
}
</code></pre>

<p>I tried to find out whether i am trying to access any released object. but could not figure it out. I ran the applicaion with "Zombies" instrument. It indicates that accessing an released NSNumber object is causing the issue.
I built the application using "Build and Analyze" option. Everything seems to be ok.
Can Anybody help me out?</p>

<p>. . . One more thing, The error <strong>does not occur always</strong>. if there are more than 1 records, the error may or may not occur. But If there is just a single record remaining to be deleted, the error occurs always.</p>
