0
votes

I'm having an app that saves Core Data objects to the local store for immediate or later POST to an API.

My guess was that I would get duplicate objects: (1) the object created locally and sent to the POST method and (2) one that is created when mapping the object returned from the POST call.

But RestKit seems to find the original object even if I don't have any universal identification? How can this work? I can't find any of this in the source code which makes me a little bit confused and I don't know if I can depend on this.

So:

When storing objects in Core Data and later POSTing them with RestKit, do I need an UUID so RestKit can map the actual posted object with the one returned with the POST request?

Or can I depend on Rest Kit always maps the response of the POST call to the object I sent as an argument to the POST method?

1

1 Answers

0
votes

When you POST an object, RestKit does not try to create a new object as the destination of the response mapping. It explicitly updates the supplied object that is being POSTed. You don't need to have a special identifier and you don't need to already have the object in Core Data.