I'm using UIDocumentPickerViewController
on iOS 8 to allow users to open documents in iCloud Drive.
I use UIDocumentPickerModeOpen
with the custom UTI of my app's document:
UIDocumentPickerViewController *pickerViewController = [[UIDocumentPickerViewController alloc]
initWithDocumentTypes:@[[MySampleDocument documentUTI]]
inMode:UIDocumentPickerModeOpen];
pickerViewController.delegate = self;
[self presentViewController:pickerViewController animated:YES completion:^{
}];
This works fine at first. The documents of my app show, the user can pick a document, and it gets opened in the app.
However, if I then use the document picker a second time, the same document that I just picked is now grayed out and cannot be picked again.
Why is that?
The document is still grayed out even after I quit the app. I even deleted the app and installed it again. The document is still grayed out.
I'm using UIDocument so starting and stopping security scoped access is take care of.