• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Core Data fetch request crashes the app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: User Defaults
  • Next by Date: Re: User Defaults
  • Previous by thread: Re: User Defaults
  • Index(es):
    • Date
    • Thread