I try to delete big file(1GB+) in the document directory of my developing App, the codes as below. When I deleted the file, but the space occupied by the app in iPhone storage has not changed. Does anyone know what the problem is? I have confirmed that the file has been deleted successfully. Could this be caused by the iPhone Storage cache? How can I update the cache with codes in a timely manner? Thank you.
The screenshot of iPhone Storage:
screenshot
<code>NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docPath = [searchPaths objectAtIndex: 0];
NSString *filePath = [docPath stringByAppendingPathComponent:@"test.mp4"];
[[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
</code>
<code>NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docPath = [searchPaths objectAtIndex: 0];
NSString *filePath = [docPath stringByAppendingPathComponent:@"test.mp4"];
[[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
</code>
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docPath = [searchPaths objectAtIndex: 0];
NSString *filePath = [docPath stringByAppendingPathComponent:@"test.mp4"];
[[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];