"Dynamically Linked" Models and Using Mapping Models

  • 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

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

previous month october 2007 next month
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today