• 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: Core data model configuration & Leopard
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core data model configuration & Leopard


  • Subject: Re: Core data model configuration & Leopard
  • From: Bill <email@hidden>
  • Date: Mon, 29 Oct 2007 08:42:02 -0700


On Oct 28, 2007, at 11:12 PM, Chris Hanson wrote:

On Oct 28, 2007, at 5:45 PM, email@hidden wrote:

coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: [self managedObjectModel]];

What's the implementation of -managedObjectModel look like? Is it creating a merged model from all frameworks you're using, or is it just loading a specific model from your application bundle?


It should really do the latter, so you don't wind up with extraneous entities in the schema for your SQLite persistent store. Otherwise you could wind up with a persistent store that you can't open after changing the configuration of your system or on another system.

  -- Chris



It seems to be creating a merged model from all frameworks I'm using (see below). And the app does use a lot of frameworks besides the standard set. There's Security, SystemConfiguration, and Message. I'm not sure how to load a specific model from my app bundle, but I will definitely look into it and see if that helps.

Thanks,
Bill


- (NSManagedObjectModel *)managedObjectModel {
if (managedObjectModel) return managedObjectModel;

NSMutableSet *allBundles = [[NSMutableSet alloc] init];
[allBundles addObject: [NSBundle mainBundle]];
[allBundles addObjectsFromArray: [NSBundle allFrameworks]];

managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles: [allBundles allObjects]] retain];
[allBundles release];

return managedObjectModel;
}


_______________________________________________

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: Core data model configuration & Leopard
      • From: mmalc crawford <email@hidden>
References: 
 >Core data model configuration & Leopard (From: email@hidden)
 >Re: Core data model configuration & Leopard (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Trying to delete the first char of a string?
  • Next by Date: Re: [Leopard] Debugging GC
  • Previous by thread: Re: Core data model configuration & Leopard
  • Next by thread: Re: Core data model configuration & Leopard
  • Index(es):
    • Date
    • Thread