-[NSFileManager fileExistsAtPath:] returns NO initially for existing files.

Originator:lhunath
Number:rdar://14954118 Date Originated:
Status:Open Resolved:
Product:iCloud Product Version:
Classification: Reproducible:
 
Summary:
When the application starts up for the first time on a device (or after a reset on the simulator), -[NSFileManager fileExistsAtPath:path] for a path within the application's iCloud container returns NO even for ubiquitous files that do exist.

There needs to be a guaranteed method of determining whether or not a file exists in the iCloud container, even if at the time of invocation the container is not yet fully set up or initialized locally.  I would prefer a blocking call, but I'll take solace with a call that returns a status indicating the container isn't ready yet to guarantee a response to that call.

Currently, this bug causes my app to recreate the file (seeing as it's apparently missing), which leads to data loss of the file's original contents.

Steps to Reproduce:
1. Reset the simulator
2. Enable iCloud in Settings
3. Install and start the app
4. On application launch, invoke [[NSFileManager defaultManager] fileExistsAtPath:path] where path is the path to an existing ubiquitous file in the application's ubiquity container.

Expected Results:
YES

Actual Results:
NO

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!