how to parse json file in ox code

how to parse json file in objective c, working on OX- 10.10
OX PARSE JSON NSDICTIONARY

Submitted by sunil On Saturday, 20 June 2015.
Category: Javascript

[RESOLVED]

0
1 Answers.
 
Super User
laser

Re:how to parse json file in ox code

//read file 
     
    NSString *jsonString = [[NSString alloc] initWithContentsOfFile:@"path/to/file.json" encoding:NSUTF8StringEncoding error:NULL]; 
     
    NSStringEncoding  encoding; 
    NSData *jsonData = [jsonString dataUsingEncoding:encoding]; 
    NSError *error=nil; 
    NSDictionary *parsedData = [NSJSONSerialization JSONObjectWithData:jsonData options:kNilOptions error:&error]; 
    NSLog(@"parsedData: %@", parsedData);
Submitted by Super User On Saturday, 20 June 2015
0
This Answer has been Chosen as Best Answer
Question is marked as resolved.