Pages

Handling incoming JSON redux-modified

At work I finally got on a project where we had control over the server and JSON was naturally chosen as the desired output format. This meant I could finally make use of the category to safely set properties on any NSObject descendant from a NSDictionary written by Tom Harrington published in the article Handling incoming JSON redux.

But I ran into a limit with the category, it would only set properties defined in the class itself and not properties defined in a possible super class.

Long story short, I modified the category to support single inheritance in this gist, feel free to use and/or fork.

P.s. Need to modify this theme to support code preview.