美文网首页
json文件转换plist文件

json文件转换plist文件

作者: 果然小行家 | 来源:发表于2017-11-24 09:31 被阅读0次

NSString  *path = [[NSBundle mainBundle]pathForResource:@"city_province.json"ofType:nil];

NSLog(@"path = %@",path);

NSArray *array1 = [NSJSONSerialization JSONObjectWithData:[NSData dataWithContentsOfFile:path]options:NSJSONReadingMutableLeaves error:nil];

NSString *newPath = [NSString stringWithFormat:@"%@%@",[[NSBundle mainBundle]bundlePath],@"/city_province.plist"];

NSLog(@"newPath = %@", newPath);

[array1 writeToFile:newPath atomically:YES];

相关文章

网友评论

      本文标题:json文件转换plist文件

      本文链接:https://www.haomeiwen.com/subject/jldxbxtx.html