Skip navigation.
 
mlRe: Multi-storage Core Data
FROM : Rob Napier
DATE : Thu May 22 18:05:29 2008

On May 17, 2008, at 3:54 PM, Jim Correia wrote:

> On May 17, 2008, at 3:00 PM, Keary Suska wrote:
>

>> on 5/17/08 10:27 AM, <email_removed> purportedly said:
>>

>>> I'm trying to build a Core Data app for which some data is user-
>>> provided and
>>> some data is shipped with the program. Consider a travel itinerary 
>>> program
>>> for instance where the user has a trip from airport A to airport 
>>> B. If the
>>> program includes data about the airports themselves, that 
>>> shouldn't be
>>> stored in the same storage as the user's flight numbers. One is 
>>> document
>>> based and the other is shared across documents.
>>>
>>> I understand the basic idea of using Fetched Properties and how to 
>>> create
>>> them. What I'm not clear on is how to define a fetched property in 
>>> one store
>>> against objects in another store, or how to tie multiple stores 
>>> together
>>> into a context. Is there a good explanation or sample code for 
>>> this kind of
>>> setup?

>>
>> I don't believe there is any support for this, at least not 
>> "automatically".
>> You would have to provide glue code for any interactions between 
>> Managed
>> Object Contexts (MOCs), since each MOC is married to one storage.

>
> This is not quite correct.
>
> A MOC is associated with a persistent store coordinator. A PSC can 
> have multiple stores associated with it.
>
> What you do not get for free is cross-store relationships.


Which is how I understood it, and I'm willing to write some glue here. 
But do you have any pointers on how to get started with that? I 
haven't been able to figure out with a multi-store PSC, how to direct 
some objects to one store and others to another. Examples of using 
fetched properties to create cross-store relationships are also seems 
pretty thin in the main docs. Are there any good references on Core 
Data beyond the fairly straight-forward Department app?

It looks like there have been many CD improvements in Leopard 
(transformable attributes being the one that really jumps out to me). 
It looks like it may be time for me to re-read all the docs and try 
again with the new 10.5 features.

-Rob

Related mailsAuthorDate
mlMulti-storage Core Data Rob Napier May 17, 18:27
mlRe: Multi-storage Core Data Keary Suska May 17, 21:00
mlRe: Multi-storage Core Data Jim Correia May 17, 21:54
mlRe: Multi-storage Core Data David Wilson May 17, 22:03
mlRe: Multi-storage Core Data Rob Napier May 22, 18:05
mlRe: Multi-storage Core Data Ben Trumbull May 22, 22:06