[英]How to find NSTemporaryDirectory in finder
I am using NSTemporaryDirectory() and globallyUniqueString to create a temporary directory and a unique file path. 我正在使用NSTemporaryDirectory()和globalUniqueString创建临时目录和唯一文件路径。 I will be saving a file in the temp directory and I want to know and verify the contents of the file that gets saved in the temporary directory.
我将文件保存在temp目录中,我想知道并验证保存在临时目录中的文件的内容。
NSURL *directoryURL = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]] isDirectory:YES];
[[NSFileManager defaultManager] createDirectoryAtURL:directoryURL withIntermediateDirectories:YES attributes:nil error:nil];
NSURL *fileURL = [directoryURL URLByAppendingPathComponent:uniqueFileName];
[loadedModelTemp writeToURL:fileURL atomically:YES encoding:NSUTF8StringEncoding error:NULL];
I have checked the Xcode derived data but couldn't find the folder. 我检查了Xcode派生的数据,但是找不到该文件夹。 Is this folder even accesssible?
这个文件夹甚至可以访问吗?
Sorry for asking the question quickly without checking the house first. 很抱歉没有先检查房子就迅速提出问题。 The file gets saved in
/var/
folder. 该文件将保存在
/var/
文件夹中。 I just NSlogged the fileURL
variable and got the whole path. 我只是NSlogged
fileURL
变量,并获得了完整的路径。 I 一世
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.