iOS 读取本地JSON 或者Plist文件

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]);

你可能感兴趣的:(iOS 读取本地JSON 或者Plist文件)