There are related questions on SO, such as this one, and while this issue is mentioned, it is not the crux of that question or any of the others I could find.
I have written an iOS 8.1 application called Cloudy, which is just a test bed for learning Core Data for iCloud. The documentation says that to detect a change in iCloud account status, one should listen for NSUbiquityIdentityDidChangeNotification
and then examine the value of NSFileManager
's ubiquityIdentityToken
property. Conceptually, this is very simple and straightforward. The problem is that it never happens.
Instead, my application always receives SIGKILL
when I sign out of iCloud or disable iCloud Documents. In some of the comments to the linked SO question above, some guessed that this occurs only when debugging through Xcode, but I can assure you this is not the case. It also occurs when simply launching the app without a debugger connected.
Now, SIGKILL
is just fine. In fact, it makes my life easier. The problem is that I cannot find this behavior documented anywhere, so I don't trust it. However, since I have never been able to capture NSUbiquityIdentityDidChangeNotification
, it is impossible to test any code written to handle it.
While iCloud is a great technology, the documentation for it is maybe half a notch above terrible.