• 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
"Dynamically Linked" Models and Using Mapping Models
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Dynamically Linked" Models and Using Mapping Models


  • Subject: "Dynamically Linked" Models and Using Mapping Models
  • From: email@hidden
  • Date: Wed, 31 Oct 2007 00:04:35 +0900

Ok, I will do my best to illustrate what I am doing here.

Basically, I have a framework that has an NSManagedObjectModel (xcdatamodel file) that is shared between different apps.
This is to facilitate common functionality and data types across multiple applications.


What I do is, in client applications that utilize this framework is when the managed object model is loaded, my NSPersistentDocument subclass scans it's model's entities and if it finds a specific user info entry (such as PARENT_ENTITY_FROM_FRAMEWORK_MODEL) it will get the value for that key (the name of its desired "super entity" from the framework model) and "link" its entity to that of the framework using setSubEntites:. All works fine (in Leopard that is).

The method that I link the two models from is in - (id)managedObjectModel; (NSPersistentDocumentSubclass)

So what I'm concerned is, with the new version migration in leopard going on (not to mention versioning of the framework model), what's the best way of going about linking the framework model entities to the client app entities during migration??

What is the entry point for my custom code to link the two entities from separate models before/during migration.... otherwise there would be an inconsistency between the models.........

I am thinking, that perhaps, as long as the framework model doesn't change, after migration of the applications' datastore to a new version, the NSPersistentDocument will call managedObjectModel: for the newly migrated store.... in which case I might have to do nothing at all (preferable)... but that still leaves the nagging problem of the framework model changing at some point......... (which it largely shouldn't)

Any pointers (I have read the documentation since the betas) would be appreciated.

Andre

_______________________________________________

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


  • Prev by Date: Re: FSCatalogInfo randomness
  • Next by Date: Re: [Q] No HexInputModePalette window?
  • Previous by thread: [ANN] MBThreadingProxies and MBFileEvents
  • Next by thread: [CoreData] Background Insertion (was Save in Core Data from another thread)
  • Index(es):
    • Date
    • Thread