我想在阅读后关闭所有文件。实际上,我想安全地移除 SD 卡,所以我需要在弹出之前关闭所有文件,但我不知道如何关闭文件。我使用代码来读取文件:
NSError *error = nil;
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/test.txt", drive_url]];
NSLog(@"url %@",url);
NSMutableData *dataText = [NSMutableData dataWithContentsOfURL:url options:NSDataReadingUncached error:&error];
if (error) {
NSLog(@"%@", [error localizedDescription]);
}else {
NSLog(@"Data loaded successfully");
NSLog(@"Data %@",dataText);
}
如何关闭 test.txt 文件?提前致谢