NSString *path = [[NSBundle mainBundle] pathForResource:@"address.json" ofType:nil];
NSLog(@"path = %@",path);
NSArray *array = [NSJSONSerialization JSONObjectWithData:[NSData dataWithContentsOfFile:path] options:NSJSONReadingMutableLeaves error:nil];
NSString *newPath = [NSString stringWithFormat:@"%@%@",[[NSBundle mainBundle] bundlePath],@"/address.plist" ];
NSLog(@"newPath = %@", newPath);
[array writeToFile:newPath atomically:YES];
iOS 将json文件转为plist文件
最新推荐文章于 2022-07-18 10:41:58 发布