简体   繁体   English

在本地存储和删除文本文件ios目标c

[英]store and delete text file locally ios objective c

I'm new to ios(android) developer. 我是ios(android)开发人员的新手。 Do you have some specific file storage in the app's sandbox where i can store or delete some additional files? 应用程序的沙箱中是否有一些特定的文件存储空间,我可以在其中存储或删除一些其他文件?

I need to write to file some logs of handled exceptions and then store them to server when starting the application. 我需要写一些处理过的异常的日志文件,然后在启动应用程序时将它们存储到服务器。 After successful delievery to server, i want to delete this log file, and create new one, and do it again and again. 成功转存到服务器后,我想删除此日志文件,并创建一个新文件,然后一次又一次地执行。

NSArray* paths = NSSearchPathForDirectoriesInDomains (NSApplicationSupportDirectory, NSUserDomainMask, YES);
NSString* directory = [paths objectAtIndex:0];

Also consider NSDocumentDirectory and NSCachesDirectory . 还要考虑NSDocumentDirectoryNSCachesDirectory

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM