如果 NSTemporaryDirectory 返回 nil
根据文档,NSTemporaryDirectory()
可以返回 nil。我需要在设备中保存一些临时文件。如果 NSTemporaryDirectory()
返回 nil 我该怎么办?我应该在其他地方创建一个文件夹吗?如果是,在哪里?或者我应该向用户显示一条消息?
According to the documentation, NSTemporaryDirectory()
can return nil. I need to save some temporary files in the device. What should I do if NSTemporaryDirectory()
returns nil? Should I create a folder elsewhere? If yes, where? Or should I just show a message to the user?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里有一个潜在的替代路径: http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/URLForDirectory :inDomain:propertyForURL:create:error:(
如果主题标签无法向下滚动页面,请查看
-[NSFileManager URLForDirectory:inDomain:propertyForURL:create:error:]
)A potential alternate path here: http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSFileManager_Class/Reference/Reference.html#//apple_ref/occ/instm/NSFileManager/URLForDirectory:inDomain:appropriateForURL:create:error:
(in the event the hashtag fails to scroll you down the page, check out
-[NSFileManager URLForDirectory:inDomain:appropriateForURL:create:error:]
)它是临时文件一零自由区,就像文件临时一二一样,
一是临时一,二和二是两种不同的类型,它们都是最好的类型
It’s temp file one nil free zone like file temp one two
One is temp one and two and two are the two different types and they both are the best ones