您的位置:首页 > 其它

解决关于打开plist文件乱码问题,plist转换为xml文件的txt文件!

2013-12-16 22:30 666 查看
自己是程序员,干嘛不自己写代码完成?下载工具还不一定管用!具体解决方案如下:

1,获得内容

NSArray *dictionary = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"DiseaseListData" ofType:@"plist"]];

2,保存文件格式和路径
NSString *documents = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject;
NSString *filePath = [documents stringByAppendingString:@"/lala.txt"];

3,把内容保存到txt文件
[dictionary writeToFile:filePath atomically:YES];
NSLog(@"%@",[NSBundle mainBundle].resourcePath);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: