Given, a file of path [[self documentsDirectory] stringByAppendingPathComponent:@"myFiles/aFile.txt"], How do I delete a file in my apps documents directory?
[[self documentsDirectory] stringByAppendingPathComponent:@"myFiles/aFile.txt"]
NSFileManager is a very handy tool:
[[NSFileManager defaultManager] removeItemAtPath: pathToFile error: &error];
2.1m questions
2.1m answers
60 comments
57.0k users