user1915453
user1915453

Reputation: 73

Restoring icloud data to app

In my app i sync my data to iCloud successfully, Even i can see that file iCloud settings. But now i dont know how get that file back from iCloud to my app.

enter image description here

Please help me how get that file back

Upvotes: 0

Views: 207

Answers (1)

Halen
Halen

Reputation: 456

The document already exists where you want it. You just need to do the right thing to access it. Use the URL that you get from your code, but don't include the last part with @"filename."

Pass the url to this method on the file manager:

  • (NSArray *)contentsOfDirectoryAtURL:(NSURL *)url includingPropertiesForKeys:(NSArray )keys options:(NSDirectoryEnumerationOptions)mask error:(NSError *)error

The NSArray contains NSURL objects which point to the files and folders in that directory. Use the URL of the file that you want and open it as appropriate. For more info, see the NSFileManager documentation.

Upvotes: 1

Related Questions