问题
How can I create a directory inside NSTemporaryDirectory
? I tried something like:
[NSTemporaryDirectory() stringByAppendingPathComponent:@"/myTmp/"];
followed by the file name, but it didn't work.
回答1:
Use NSFileManager
to create the directory for you:
[[NSFileManager defaultManager] createDirectoryAtPath:[NSTemporaryDirectory() stringByAppendingPathComponent:@"/myTmp/"]
withIntermediateDirectories:YES attributes:nil error:nil];
来源:https://stackoverflow.com/questions/6847788/create-directory-inside-nstemporarydirectory