Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
クラスのメソッド-writeData:は何も返しません。NSFileHandle操作が成功したかどうかを判断する方法はありますか? または、他の方法でデータを保存する必要がありますか?
-writeData:
NSFileHandle
標準の cocoa オブジェクトは、非常に簡単にファイルに書き込むことができます。成功したかどうかにかかわらず、これは BOOL 値を返します。
BOOL result = [YOUR_OBJECT writeToFile:@"absolute/file/path" atomically:YES]]; if (result) NSLog(@"All went well"); else NSLog(@"File was not saved");