Restkit Serializing a Boolean from NSNumber

Posted by angelokh on Stack Overflow See other posts from Stack Overflow or by angelokh
Published on 2012-07-08T05:40:58Z Indexed on 2012/10/03 15:37 UTC
Read the original article Hit count: 297

One of managed objects has one attribute 'isMember' represented by NSNumber type. When serialize to Json post body by RestKit, it always give 0/1 instead of YES/NO or true/false. When mapping from json result to objects, RestKit is able to successfully turn YES/NO to NSNumber. What is the way to force serialize the boolean attribute to YES/NO or true/false?

Serialize: 0 -> 0, 1 -> 1

Deserialize : YES/true -> 1, NO/false -> 0

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about serialization