- (NSDictionary *)readLocalFileWithName:(NSString *)name
{
// 获取文件路径
NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"json"];
// 将文件数据化
NSData *data = [[NSData alloc] initWithContentsOfFile:path];
return [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:nil];
}
网友评论