我正在向我的documents目录写入数据,我想知道是否有一种方法可以判断我的writeToFile方法何时完成,我正在创建的文件何时完全创建。提前感谢,这里是我正在调用的方法,我只是在寻找一种方法,它是一个委托方法,还是其他一些方法,来告诉这个方法什么时候完成。
[imageData writeToFile:fullPathToFile atomically:YES];
尼克
发布于 2012-04-07 05:13:17
writeToFile:atomically
方法是“同步的”。它将写入文件,然后根据文件是否成功写入返回YES
或NO
。
这意味着只要方法返回,操作就完成了。
BOOL success = [imageData writeToFile:fullPathToFile atomically:YES];
// Now, the operation is complete
// success indicates whether the file was successfully written or not
https://stackoverflow.com/questions/10049245
复制相似问题