Built.io joins Software AG! Read all about the news.

Built.io Blog

JSON to Objective C Model Generation


For almost every iOS app you develop that interacts with a web service (most apps), the preferred format to transmit data over http is JSON.

As Objective C developers, we map the JSON structure to our Objective C model files. I have done this process for a handful of projects untill I was finally fed up with repeating the same process endlessly. So I decided to write some code that would automate it for me.

I have decided to share this project that does this mapping for me through GitHub. You just need to pass the JSON structure to it and it creates the interface and implementation files (.h and .m) for you.

Here’s how:

  1. Open the project in Xcode 4.
  2. Navigate to /json folder and find the json.json file.
  3. Paste your JSON structure here.
  4. Build and run the project and check the console for the path of the generated files.


Currently, it does not work with nested JSON and all properties that are generated are NSString.


In the future, I intend to add support for nested JSON and for different dataypes (string, int, etc.) and also arrays.

The project can be found on GitHub

Please feel free to fork it!

Popular Posts

Subscribe to our blog