Last Updated: February 25, 2016
·
1.985K
· gabrielwebb

JSON in iOS

So I tackled JSON today and I found that it is super fast and very worth while to use. I had it up and running in about 10 minutes. Four blocks of code and it was ready. The tutorial I found use macros which I'm still not sure if I am fond of them yet or not. The tutorial took maybe 20 mins or so. I was trying to soak it up.

- (void)fetchedData:(NSData  *)responseData {
//parse out the json data
NSError * error;
NSDictionary * json = [NSJSONSerialization 
                       JSONObjectWithData:responseData //1

                       options:kNilOptions 
                       error:&error];

That is a sample of the code I used. Very simple and quick


Note-
here is where you can find the tutorial I used http://www.raywenderlich.com/5492/working-with-json-in-ios-5