读取.json文件代码部分
NSString * json = [[NSBundle mainBundle] pathForResource:@"data" ofType:@"json"];
NSData *data=[NSData dataWithContentsOfFile:json];
NSError *error;
NSDictionary * dict =[NSJSONSerialization JSONObjectWithData:data
options:NSJSONReadingAllowFragments
error:&error];
网友评论