I'm using a UIDocumentPickerViewController
in my iOS app to allow users to open external files. I have added the relevant iCloud entitlements to my app bundle, and most of the time everything is working great.
However, occasionally the document picker will crash, complaining that the app is missing this iCloud entitlement. I have found experimentally that when this happens, the value of [NSFileManager defaultManager].ubiquityIdentityToken
is usually nil, so I have guarded my call to the document picker with a check to the ubiquityIdentityToken
as a temporary measure.
Can anybody shed some light on what might be happening here, and what I can do to avoid this crash? It seems almost totally out of my control.
Happening to my app as well -- I just want to use the File Provider features, and don't support iCloud Drive specifically.
I can't shed any light on why it seems to lose touch with iCloud, but this is not a "crash" -- [[UIDocumentPickerViewController alloc] init___]
is throwing an exception, which you can catch with a try/catch block. That is, I suspect your app is crashing with "uncaught exception" -- if you catch it, you can just give an error message.