首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >NSPicturesDirectory在IOS中的用途

NSPicturesDirectory在IOS中的用途
EN

Stack Overflow用户
提问于 2014-04-28 07:45:42
回答 2查看 970关注 0票数 0

基础常数参考中什么是

代码语言:javascript
运行
复制
NSMoviesDirectory
NSMusicDirectory
NSPicturesDirectory

如果我正在处理图像,我应该存储在NSPicturesDirectory中吗?

EN

Stack Overflow用户

回答已采纳

发布于 2014-04-28 12:07:06

NSSearchPathDirectory枚举定义了应该存储特定类型文件的文件夹位置。

这个想法是,这些位置决定了用户希望找到应用程序/文档/图片/电影的路径.

例如:

代码语言:javascript
运行
复制
typedef NS_ENUM(NSUInteger, NSSearchPathDirectory) {
    NSApplicationDirectory = 1,             // supported applications (Applications)
    ...
    NSLibraryDirectory,                     // various documentation, support, and configuration files, resources (Library)
    NSDocumentationDirectory,               // documentation (Documentation)
    NSDocumentDirectory,                    // documents (Documents)
    ...
    NSDesktopDirectory = 12,                // location of user's desktop
    ...
    NSMoviesDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 17,                 // location of user's Movies directory (~/Movies)
    NSMusicDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 18,                  // location of user's Music directory (~/Music)
    NSPicturesDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 19,               // location of user's Pictures directory (~/Pictures)
     ...
    NSTrashDirectory NS_ENUM_AVAILABLE(10_8, NA) = 102                   // location of Trash directory
};

现在..。真正的位置(文件路径)是基于应用程序的存储位置。

由于在IOS中没有用户可见的文件系统,特别是因为每个应用程序都运行在自己的沙箱中,所以它们的用处有限:

他们只告诉操作系统在哪里找到什么,它可能会假设如何处理这些位置:例如缓存可以随意丢弃,文档必须保存.电影/图片

请记住,虽然IOS只看到缓存/其他任何东西,OSX对路径的处理方式却是不同的。

票数 2
EN
查看全部 2 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23335316

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档