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


更多技术性文章请关注 合伙呀

自己是程序员,干嘛不自己写代码完成?下载工具还不一定管用!具体解决方案如下:

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);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM