Created
July 16, 2015 11:25
-
-
Save mutekinootoko/94e219f9ccf8f6b6d64c to your computer and use it in GitHub Desktop.
generates temp folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString*) tempFolderPath { | |
if(_tempFolderPath == nil) { | |
NSError* err; | |
_tempFolderPath = [NSTemporaryDirectory() stringByAppendingPathComponent:[[NSProcessInfo processInfo] globallyUniqueString]]; | |
[[NSFileManager defaultManager] createDirectoryAtPath:_tempFolderPath withIntermediateDirectories:YES attributes:nil error:&err]; | |
NSLog(@"temporary folder created at %@", _tempFolderPath); | |
if(err) { | |
NSLog(@"error when creating temporary folder. %@", err); | |
// TODO better error handler | |
} | |
} | |
return _tempFolderPath; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment