iOS 读取本地JSON 或者Plist文件
2016-10-17 本文已影响1973人
Paco_Ke
NSString *jsonPath = [[NSBundle mainBundle] pathForResource:@"china_Updated" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:jsonPath];
NSError *error = nil;
id result = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:&error];
NSLog(@"\n%@", [error localizedDescription]);