writeToFile how to tell when it is completed
ios, iphone
Solution
The method `writeToFile:atomically` is "synchronous". It will write the file and then return `YES` or `NO` depending on wether the file was successfully written or not.
That means that the operation is complete as soon as the method returns.
BOOL success = [imageData writeToFile:fullPathToFile atomically:YES];
// Now, the operation is complete
// success indicates whether the file was successfully written or not
Problem
I'm doing some writing of data to my documents directory and I was wondering if there is a way to tell when my writeToFile method completes and the file I am creating has be fully created. Thanks in advance here is the method I am calling I am just looking for a way wether it is a delegate method or some other way to tell when this completes. ``` [imageData writeToFile:fullPathToFile atomically:YES]; ``` Nick