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];
1.4m articles
1.4m replys
5 comments
57.0k users