Core Data fetch request crashes the app
Core Data fetch request crashes the app
- Subject: Core Data fetch request crashes the app
- From: Chataka <email@hidden>
- Date: Tue, 1 May 2007 13:37:42 +0900
I am trying to fetch an array of managed objects but sometimes it
crashes my app.
--------
NSEntityDescription * entity = [NSEntityDescription entityForName:
(an entity name)
inManagedObjectContext: managedObjectContext];
NSFetchRequest * fetchRequest = [[NSFetchRequest alloc] init];
[fetchRequest setEntity: entity];
[fetchRequest setPredicate: (a predicate)];
NSArray * fetchedMOArray;
NSError * error;
fetchedMOArray = [managedObjectContext executeFetchRequest: fetchRequest
error: &error];
--------
The code usually works, but when I remove a managed object through an
NSArrayController (removeObject:) before executing this code, the app
is crashed
when the last line (executeFetchRequest: error:) is executed.
My questions are that are there any timings or conditions that fetch
request is not allowed,
and if there are, how can I avoid them.
Thank you.
Chataka
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden