I have been following these instructions to help integrate iCloud support with CoreData and I am getting some errors.
I have this in my AppDelegate:
You are probably calling persistentStoreCoordinator
method from two (or more) different threads. Either directly or indirectly.
As written that method is not thread safe.
It may be you have other methods with the same problem. Typically managedObjectContext
exists and is written in a similar way.
There are two ways to solve this problem:
@synchronize
to make those methods thread safenil
The second thing that you may also be doing wrong is to modify the context (for example adding new managed objects to it) and then trying to save it, before the store has been initialized.
To solve this make sure you do either one of the following:
RefetchAllDatabaseData
notification and you notice the database is empty).