In my code I'm doing:
[anNsDataObject writeToFile:@"thefile" atomically:YES];
How can I delete this file from my device?
Using NSFileManager
's removeItemAtPath:error:
method.
Example:
NSError *error;
[[NSFileManager defaultManager]removeItemAtPath:@"theFile" error:&error];
if (error)
{
// file deletion failed
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With