I am working on file sharing on my iOS App, I am new to UIDocumentPickerViewController
. I do not know why my app is crashing.
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithDocumentTypes:@[@"public.image"] inMode:UIDocumentPickerModeImport];
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentViewController:documentPicker animated:YES completion:nil];
App is crashing on the highlighted lines.
Has anyone done this previously? I want to do the same like the attachment below
swift 3.0 you can select all document.
See
Prerequisite
section on Apple Documentation:Let me know if this solve your problem!
Even with all entitlements set up, this still happens every now and then, when running on a device (not simulator).
The best solution I've found so far is:
UIDocumentPickerViewController
.UIDocumentPickerViewController
will init as intended.From my experience, it will work until you install a TestFlight build. Sometimes you'll need to do this again after restarting Xcode.
This certainly looks like a bug with installing entitlements on the device.
(Xcode 7.2, iOS 9.2)