• 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
Re: NSManagedObjectModel initWithContentsOfURL: returns nil
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSManagedObjectModel initWithContentsOfURL: returns nil


  • Subject: Re: NSManagedObjectModel initWithContentsOfURL: returns nil
  • From: Chris Hanson <email@hidden>
  • Date: Thu, 16 Oct 2008 14:48:39 -0700

On Oct 16, 2008, at 2:33 PM, Todd Blanchard wrote:

I've been trying to open this core data model all day. XCode can open it.
I'm passing the path the the model file as a file path parameter.


NSManagedObjectModel* model = [[NSManagedObjectModel alloc]initWithContentsOfURL:[NSURL fileURLWithPath:modelFile]];


The path is /Users/todd/Projects/MyProjectGroup/MyProject/ BusinessModel.xcdatamodel/

What you're trying to open is an Xcode data model, which Xcode can compile into a Core Data managed object model (".mom") file. Core Data can't read Xcode data model files directly.


In part, this is because Xcode data model files are allowed to be inconsistent for development convenience -- for example, they can have relationships with no destination entity set -- while Core Data managed object model files require a minimum amount of consistency. Xcode's model compiler will generate warnings and errors to enforce that consistency during model compilation.

  -- Chris

_______________________________________________

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


References: 
 >NSManagedObjectModel initWithContentsOfURL: returns nil (From: Todd Blanchard <email@hidden>)

  • Prev by Date: NSManagedObjectModel initWithContentsOfURL: returns nil
  • Next by Date: Re: Calling UNIX command from Cocoa
  • Previous by thread: NSManagedObjectModel initWithContentsOfURL: returns nil
  • Next by thread: Hand-building an Application Menu
  • Index(es):
    • Date
    • Thread