Search code examples
ios5icloudnsmetadataquery

Two iCloud devices get different results with NSMetaDataQuery


I'm using iCloud to store small audio files with a simple UIDocument class. Running iOS 5.1 on an iPhone 4s and an iPad 1. The iPad is communicating properly with the iCloud container. As I create documents, I see them pop into the iCloud store from Settings->iCloud->Storage&Backup->ManageStorage->MyAppName on both the iPhone and the iPad. The iPhone, however, seems to be connecting to it's own separate store. Files I create there do not show up in Settings on either device but appear to go to some container somewhere. I can see them when running an NSMetaDataQuery (but I don't see the documents from the real iCloud container).

How the problem began: When I first created the iCloud entitlement and container identifier, I omitted the "com." prefix from the store name. This worked fine until I submitted an app update to Apple and they immediately rejected the upload citing an invalid iCloud container identifier. My problems began after I changed the identifier. I have deleted and reloaded the app on both devices, but the iPhone is still stuck using what appears to be an invisible iCloud container.

Please help me get my phone back in sync with the real iCloud container. Thanks!


Solution

  • This appears to be an Apple bug with iCloud. I restored my iPhone 4s to its original settings and everything now works fine.