I’ve mentioned a number of number of libraries such as JSONModel for working with Objective-C code providing ways to convert JSON data to objects with a number of extraf eatures.
Here’s a lightweight library that provides dead simple conversion of JSON data to objects and collections called CollectionFactory from Elliot Chance.
The library provides a set of categories for NSArray, NSDictionary, NSMutableDictionary and NSObject for easily importing JSON data into these structures, and exporting data from these structures as JSON data.
The readme for CollectionFactory lists the following method additions:
NSArray
+ arrayWithJsonString: – create an NSArray from a JSON string.
+ arrayWithJsonData: – create an NSArray from a JSON data.
NSDictionary
+ dictionaryWithJsonData: – create an NSDictionary from a JSON data.
+ dictionaryWithJsonString: – create an NSDictionary from a JSON string.
NSMutableDictionary
+ mutableDictionaryWithJsonString: – create an NSMutableDictionary from a JSON string.
+ mutableDictionaryWithJsonData: – create an NSMutableDictionary from a JSON data.
+ mutableDictionaryWithJsonFile: – create an NSMutableDictionary from a file that contains JSON.
NSObject
+ objectFromJson: – convert JSON string into an object.
– dictionaryValue – convert an objects properties into an NSDictionary.
– jsonValue – translate any object into JSON.
You can find CollectionFactory on Github here.
A nice library for working with JSON data.
- Categories To Shorten Your Objective-C Code Including JSON Helpers, And NSComparisonMethods For iOS
- Tutorial: How To Use The JSONModel Library For Easily Handling JSON Data
- Using Objective-C JSON To Do Translations In An iOS App
- Open Source:NSNotification And KVO Objective-C Categories For Automatic Observer Removal
- Nice Simple NSObject Category Allowing Easy Serialization/Deserialization From XML or JSON
Original article: A Set Of iOS Object And Collection Categories For Easy Importing And Creation Of JSON Data
©2014 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.




