简体   繁体   English

如何通过NSURL访问iPad文档目录

[英]How do I access an iPads Document Directory through an NSURL

I am building an app that uses core data to store objects internally, and the URL for document directory is always returning nill. 我正在构建一个使用核心数据在内部存储对象的应用程序,文档目录的URL始终返回nill。

[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];

What am I doing incorrectly, or am I no where close to where I need to be? 我做错了什么,还是我离需要的地方不远? Any help will be greatly appreciated. 任何帮助将不胜感激。 Thanks! 谢谢!

Use NSCachesDirectory if this data can be downloaded again. 如果可以再次下载此数据,请使用NSCachesDirectory。 Or NSApplicationSupportDirectory if this data can't be restored. 或NSApplicationSupportDirectory(如果无法还原此数据)。

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

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