Restkit + CoreData: How to save/sync objects with custom strategy ?

167 views
Skip to first unread message

Frederic Visticot

unread,
Jun 3, 2012, 5:04:14 PM6/3/12
to res...@googlegroups.com
I need to synchronize my local DB and my server with a custom strategy:
- Based on a timestamp attribute on the object

It seems currently not possible with Restkit to define our own sync method...

My idea is to remove the :

objectstore= [RKManagedObjectStore objectStoreWithStoreFilename:@"store.sqlite"];

_objectManager.objectStore =objectstore; //remove this line

When I remove this line, the new records are not saved in DB but the mapping is done and the following method is called with NSManaged objects

- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects

I was planing to make my own logic to add / remove objects in local DB in that method... but the [objectstore save: &error] does not save my NSManaged objects...

Any idea ?


I need to know as well when a new object as been added in the DB for the first time.
My previous question could help me to solve this pb...any other solution ?


Reply all
Reply to author
Forward
0 new messages