• 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
NSEntityDescription random crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSEntityDescription random crash


  • Subject: NSEntityDescription random crash
  • From: Nicolas Lapomarda <email@hidden>
  • Date: Thu, 10 Jul 2008 15:56:37 +0200

Soon after the main nib has been loaded, I need to execute a fetch request. Now as the title says, the crash is "random": sometimes the app executes just fine, sometimes it crashes.

When it does crash, here is where it happens:

[NSEntityDescription entityForName:anEntityName inManagedObjectContext:managedObjectContext]

The error I'm getting is random as well, but always takes the form

"*** -[NSCFString _entityForName]: unrecognized selector sent to instance xxx".

What changes launch after launch is the name of the class I'm supposedly sending the message to. I've seen NSCFString, NSCFArray, _NSPlaceholderTextFieldPlugin and other exotic class names...

I've also tried getting the entity description with the equivalent code below...

NSManagedObjectModel *managedObjectModel = [[managedObjectContext persistentStoreCoordinator] managedObjectModel];
NSEntityDescription *entity = [[managedObjectModel entitiesByName] objectForKey:anEntityName];


... but the equivalent problem occurs ("*** -[NSCFString entitiesByName]: unrecognized selector sent to instance xxx").


The code above is executed in a method called from -awakeFromNib. As the nib file contains tree / array controllers that query the same managedObjectContext, I've tried delaying the execution of my method using performSelector:withObject:afterDelay: but it didn't seem to help.


Is NSEntityDescription acting crazy or am I?

Nick
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Follow-Ups:
    • Re: NSEntityDescription random crash
      • From: "Shawn Erickson" <email@hidden>
    • Re: NSEntityDescription random crash
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: Why can't I name a property `tag'?
  • Next by Date: Re: Storing structured data in file - any easy way?
  • Previous by thread: Re: Why can't I name a property `tag'?
  • Next by thread: Re: NSEntityDescription random crash
  • Index(es):
    • Date
    • Thread