If NSTemporaryDirectory returns nil
According to the documentation, 开发者_如何学GoNSTemporaryDirectory()
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?
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:]
)
精彩评论