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
}