Skip to content

Instantly share code, notes, and snippets.

@keicoder
Created January 14, 2014 02:56
Show Gist options
  • Save keicoder/8412277 to your computer and use it in GitHub Desktop.
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)
//파일/디렉토리 삭제 (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