user826955
user826955

Reputation: 3206

iCloud storage broken after change of core data model

I've managed to have iCloud synchronize my core data database between devices (iPad and iPhone), but since the app is still under development, I happened to change the core data model. This lead to tons of error messages from iCloud upon startup, and I just can't get rid of them.

I know that iCloud is somewhat incompatible with model migration and stuff, but at the moment this is not a problem, since I want to just wipe all of the iCloud storage. I already tried to delete the ubiquity containers, and even deleted all of the apps storage through device/icloud settings - still I can't get the app back to work. It fails now to add a persistant store.

How can I completely delete the storage files of my app, so I can start over from scratch?

Upvotes: 4

Views: 389

Answers (3)

Trausti Thor
Trausti Thor

Reputation: 3774

You have to use versioning in your core data model, like is explained here :

Xcode 4, Core Data Model Version - Set Current Version

This allows your application to go back and forth in data model versioning.

Apple also allows you to delete your datastore.

But I would recommend that you don't do iCloud syncing until you are done with your data model design.

Here is more information : http://developer.apple.com/library/ios/#releasenotes/DataManagement/RN-iCloudCoreData/

Upvotes: 0

Sauceboi
Sauceboi

Reputation: 31

During development, I changed the ubiquity container name when inconsistency occurred (in the target settings). That was the best way to start from scratch for me.

Upvotes: 0

Dan Fairaizl
Dan Fairaizl

Reputation: 2170

I've had some success getting around this problem by remaining the .sqlite database/directory and also changing the directory for the transaction logs to something else.

This in addition to deleting everything from the device and data from iCloud Settings as you mentioned seemed to help.

Upvotes: 1

Related Questions