ios - Serializing a custom object into NSDictionary or NSArray to use NSJSONSerialization -


i've been looking way serialize custom objects nsjsonserialization avoiding use of third-party libraries, , couldn't find example. there way of "automatically" create nsdictionary , nsarray object, without having create typing in code object's member names 1 one , setting manually values? found related post, pretty old, things may have changed.

thanks

you can use kvc ask object dictionarywithvaluesforkeys: give dictionary representation of object.

if need change property / key names want mapping , (depending on you're using json for) may find restkit useful.


Comments