knagode
knagode

Reputation: 6125

Update single attribute with Restkit

I want to update ONE SINGLE attribute on the Core Data Object and send the change to the server using RestKit.

I see that ResKit is always sending Object with ALL attributes and not only with the changed ones. That makes my app slow(er).

I also see that update response from server should return whole object back to the RestKit which is again slower that it could be (All I need is success/failure response)

Is there elegant solution for this? (I am pretty new to the RestKit)

Upvotes: 1

Views: 60

Answers (1)

Wain
Wain

Reputation: 119031

You can create a request descriptor on-the-fly which includes only the attributes you want to send, you would either simply need to use a mapping operation yourself or be sure to only run one such operation at a time and call removeRequestDescriptor: on the object manager (this could be tricky for you to manage). The alternate is to put the data to upload into a dictionary and upload that, but that isn't ideal.

For the response, the mapping says what to map but it doesn't all have to be there, RestKit will take whatever it can and map that.

Upvotes: 1

Related Questions