4

如何在里面创建目录NSTemporaryDirectory?我试过类似的东西:

[NSTemporaryDirectory() stringByAppendingPathComponent:@"/myTmp/"];

后跟文件名,但它不起作用。

4

1 回答 1

7

用于NSFileManager为您创建目录:

[[NSFileManager defaultManager] createDirectoryAtPath:[NSTemporaryDirectory() stringByAppendingPathComponent:@"/myTmp/"] 
    withIntermediateDirectories:YES attributes:nil error:nil];
于 2011-07-27T16:23:18.313 回答