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 (
.m) for you.
- Open the project in Xcode 4.
- Navigate to
/jsonfolder and find the
- Paste your JSON structure here.
- 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
In the future, I intend to add support for nested JSON and for different dataypes (
int, etc.) and also
The project can be found on GitHub
Please feel free to fork it!