0
votes

I have an app which I want to work the same every time, regardless of whether or not iCloud is enabled. Thus, I want to store my core data persistent store in the same place with iCloud enabled as I would without it enabled.

If iCloud is enabled, calling

NSURL *iCloudURL = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier];

gives the result:

file://localhost/private/var/mobile/Library/Mobile%20Documents/12345~com~andrew~icloudid/

Calling this without iCloud enabled returns nil. I'd like to be able to access it when iCloud isn't enabled, to still use my core data store from there.

1

1 Answers

0
votes

Try this same setup on the device rather than the simulator.

You will discover that the ubiquity container URL will be the same regardless of the user setting.