Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Core Data with iCloud is never switching from `Using local storage: 1`

I've got iCloud set up with Core Data, but it never seems to switch to use the ubiquitous storage from the local storage. Looking at the iCloud panel in Xcode I can see the iCloud status is Idle, and I can even see that directories are being created inside my ubiquitous container (NSPersistentStoreUbiquitousContentNameKey), but there is never any activity (uploads or downloads) on the graph.

I'm only getting the following in the console:

-[PFUbiquitySwitchboardEntryMetadata setUseLocalStorage:](760): CoreData: Ubiquity:  me~3C82877D-69EE-5968-A69C-37FD71227462:MyApp
Using local storage: 1

I'm expecting it to eventually flip to not use local storage, but this never happens.

Setting the ubiquity log level to 3, I can see the following logs in my console:

__60-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:]_block_invoke(1289): CoreData: Ubiquity:  Coordinated read finished for ubiquity root url: file:///Users/me/Library/Mobile%20Documents/VK94X636H2~com~company~MyApp/
-[NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:](1081): CoreData: Ubiquity:  Post store setup succeded. <NSSQLCore: 0x10040bc90> (URL: file:///Users/me/Library/Containers/com.company.MyApp/Data/Library/Application%20Support/CoreDataUbiquitySupport/me~3C82877D-69EE-5968-A69C-37FD71227462/MyApp/33D95E86-2331-4ED6-9ECF-FC88E130A38F/store/MyApp.storedata)
-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:](1298): CoreData: Ubiquity:  Read finished: 1
-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:](1301): CoreData: Ubiquity:  Read finished: 1 / 1 / file:///Users/me/Library/Mobile%20Documents/VK94X636H2~com~company~MyApp/CoreData/MyApp/
-[PFUbiquitySetupAssistant canReadFromUbiquityRootLocation:](1305): CoreData: Ubiquity:  Blocking for initial sync: <PFUbiquitySetupAssistant: 0x10021edc0>

So it seems it's stuck on the Blocking for initial sync, but I'm not sure why.

Does anyone know what might be wrong?

like image 864
Michael Waterfall Avatar asked Mar 28 '14 11:03

Michael Waterfall


1 Answers

Well, it turned out that simply restarting my Mac fixed this problem.

A little concerning given iCloud's reputation, but at least it is working! It appears that even after the improvements to iCloud in iOS 7 and OS X 10.9 there's still some strange issues going on.

like image 108
Michael Waterfall Avatar answered Oct 15 '22 06:10

Michael Waterfall