Hi,
In my code i try to overwrite data on image save
NSData * mediaData = UIImageJPEGRepresentation(image)
[mediaData writeToFile:file options:NSDataWritingAtomic error:&err];Once this operation is completed , i try to read the data from the same file but on different thread
I somehow get back the old data , rather than the new written data.
I am reading
[NSData dataWithContentsOfFile:localImageUrl options:NSDataReadingUncached error:&err]-Pavan
I suspect you have a race condition here, that is, your reader thread is reading the data before your writer thread has finished. The NSData calls you reference do not buffer the data in user space, and the kernel’s file system cache is coherent.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"