Get Updates By E-mail 

Article Written By:
Johann Dowa

A Set Of iOS Object And Collection Categories For Easy Importing And Creation Of JSON Data

  •  
  •  
  •  
  •  
  •  

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.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments