Core Data & SyncServices connection
Core Data & SyncServices connection
- Subject: Core Data & SyncServices connection
- From: Joris Kluivers <email@hidden>
- Date: Sat, 27 Aug 2005 14:08:06 +0200
Hello all,
I'm at the moment experimenting using core data and sync services. In
my application I have one entity in the core data model. The entity
has two relations, children (a one to many relation to itself) and an
inverse relation for the children called parent.
I'm trying to sync this tree using the syncservices with other
instances of the application (on the same machine, or on other
machines) but I'm running into problems when it comes to constructing
the core data object tree from data received from te sync service
truth database.
Say I have two clients, A and B. I create one instance of my entity in
the core data model in client A. The relations parent and children are
still undefined. When I sync my data, application B receives a
ISyncChange, wich record can be converted to my core data entity and
inserted into the managedobjectcontext.
Now I add a child to the entity I just added in application B. For
this second instance of my entity in the data model parent refers to
the first instance.
Lets assume I push this new instance to the sync server.
Application A now receives an update from the sync server. It gets
pushed a ISyncChange. If I want to add the record from this
ISyncChange to my core data object model I first have to find the
parent in the existing tree. But parent property contains a reference
to an entity in the sync service tree, more specific, a
recordIdentifier. But objects in a ManagedObjectContext are identified
by an objectID.
Is there an easy way to connect a sync service schema to an core data
object model. Or do I have to create a mapping by hand (for example,
creating a guid property both in my sync schema and in my core data
object model).
How do you manage the relation between the two object models?
Thanks in advance,
Joris Kluivers
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden