Created
January 14, 2014 02:56
-
-
Save keicoder/8412277 to your computer and use it in GitHub Desktop.
objective-c : 파일/디렉토리 삭제 (code snippet that can use to remove any file or folder)
This file contains hidden or 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
//파일/디렉토리 삭제 (code snippet that can use to remove any file or folder) | |
- (void)removePhotoFile | |
{ | |
NSString *path = [self photoPath]; | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
if ([fileManager fileExistsAtPath:path]) { | |
NSError *error; | |
if (![fileManager removeItemAtPath:path error:&error]) { | |
NSLog(@"Error removing file: %@", error); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment