0

I'm using RestKit for posting objects to the server. In my object I have two properties: name and socialId.

I want to send to server only properties that have data.

If name != nil send:

{
   "name" : "name",
}

If socialId != 0 send:

{
   "socialId" : socialId,
}

But RestKit sends all data. For example:

{
   "name" : "",
   "socialId" : 0,
}

How can I change this behavior?

4

1 に答える 1

0

答えは [RKDynamicMapping setObjectMappingForRepresentationBlock:] を使用することです

ブロック内の表現プロパティを確認し、必要なプロパティの属性マッピングを追加する必要があります。

于 2013-04-13T07:52:41.737 に答える