demo
1.json转字典
NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"Books" ofType:@"geojson"];
NSData *data = [NSData dataWithContentsOfFile:jsonPath];
NSArray *pathResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSLog(@"%@",pathResult);
2.字典转json
NSData *data1 = [NSJSONSerialization dataWithJSONObject:pathResult options:0 error:nil];
NSString *json = [[NSString alloc] initWithData:data1 encoding:NSUTF8StringEncoding];
NSLog(@"%@",json);