解決關於打開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