IOS 获取文件夹

获取应用Home文件夹

NSString* homePath = NSHomeDirectory();

/Applications/5426E9E9-AC0B-4304-A17D-59A8AFFEA1A5


获取Document文件夹

NSArray* pathes = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES) ;

/Applications/5426E9E9-AC0B-4304-A17D-59A8AFFEA1A5/Document/


获取Library文件夹

NSArray* pathes = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,NSUserDomainMask, YES) ;

/Applications/5426E9E9-AC0B-4304-A17D-59A8AFFEA1A5/Library/


获取Cache文件夹

NSArray* pathes = NSSearchPathForDirectoriesInDomains(NSCachesDirectory,NSUserDomainMask, YES) ;

/Applications/5426E9E9-AC0B-4304-A17D-59A8AFFEA1A5/Library/Caches


获取tmp文件夹

 NSString* tempDir =   NSTemporaryDirectory();

/Applications/5426E9E9-AC0B-4304-A17D-59A8AFFEA1A5/tmp/





阅读更多
个人分类: ios
上一篇nsstring +octal
下一篇IOS 使用Archive持久化数据
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭