読んだ後、すべてのファイルを閉じたい。実は、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 ファイルを閉じるにはどうすればよいですか? 前もって感謝します