I have created a file named Dict.json .Contents of the file are valid json containg
{"mydata":[{ "A":4, "B":14, "C":7 }, { "A":4, "B":12, "C":7 }, { "A":34, "B":154, "C":6 }, { "A":34, "B":162, "C":6 }]}
I want to create a NSDictonary from this file .I tried the following but it returns nil .
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Dict" ofType:@"json"]; NSMutableDictionary *newArr1=[NSMutableDictionary dictionaryWithContentsOfFile:filePath];
I am also checking that file is not nil;
NSData *myData = [NSData dataWithContentsOfFile:filePath];
if (myData) {
NSLog("There is Data in File !!!!")
}
NSDictionary dictionaryWithContentsOfFile:
. – rmaddy