Reputation: 31
I get the idea of saving and loading from file system in ios from: How Can I Save This Array of Images?
can anyone tell me how to delete or remove it from file system?
Upvotes: 1
Views: 1880
Reputation: 2368
You can do it using NSDefaultManager
NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *pngFilePath = [docDir stringByAppendingPathComponent:imageName];
NSError *error;
[[NSFileManager defaultManager] removeItemAtPath:pngFilePath error:&error];
Upvotes: 10
Reputation: 1210
try this one:
[[NSFileManager defaultManager] removeItemAtPath: imagePath error: nil];
Upvotes: 0