lhunath / UbiquityStoreManager

Implements Core Data + iCloud, deals with all the nasty stuff and gives you a clean API.
http://lhunath.github.io/UbiquityStoreManager
Apache License 2.0
391 stars 37 forks source link

By default, can a cloud store be created instead of a local store? #61

Closed dfcarney closed 10 years ago

dfcarney commented 10 years ago

By default, UbiquityStoreManager creates a local store. Instead, if iCloud is available and no local store exists, I'd like it to skip creating a local store and focus on iCloud. Is this possible?

Related, if a local store has to be created, is there a way to detect if it's empty? In particular, if the local store is empty and there's stuff in iCloud then calling setCloudEnabledAndOverwriteCloudWithLocalIfConfirmed: prompts the user to make a selection, which is unneccessary. I.e. in this case, setting cloudEnabled = YES would be preferable.

SwiftArchitect commented 10 years ago

You can invoke [[NSUserDefaults standardUserDefaults] setBool:YES forKey:USMCloudEnabledKey]; before -initStoreNamed:withManagedObjectModel:localStoreURL:containerIdentifier:additionalStoreOptions:delegate:

lhunath commented 10 years ago

also, in you can set cloudEnabled in willLoadStoreIsCloud:

dfcarney commented 10 years ago

Great, thanks! I figured out the solution that @arquebuse mentioned a while back, but it didn't seem ideal. Thanks to both of you.