how can I delete videos stored in documents folder?
I have stored the videos in the documents folder. the path is
/Users/sridhar/Library/Applicat开发者_JS百科ion Support/iPhone Simulator/User/Applications/EC177E77-8665-485C-93DE-62350FA6D0E7/Documents/air.mp4
I want to delete the video . How can I do it programmatically.
It should work:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"air.mp4"];
BOOL succeed = [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
精彩评论