UIDocumentInteractionController
presentOptionsMenuFromBarButtonItem
gives me a console error in ios8 hardware (and not on 7.1 hardware or earlier):
Unknown activity items supplied: ( { "com.adobe.pdf" = ; }, "" )
In my official App Store version of my app, the app crashes at this point. When I compile and run on my iPad it just gives the error but does not crash.
My code:
In the .h:
UIDocumentInteractionController *docInteractionController;
In the .m:
self.docInteractionController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
self.docInteractionController.delegate = self;
//UIBarButtonItem *element is an element in my toolbar
[self.docInteractionController presentOptionsMenuFromBarButtonItem:element animated:YES];
If I do a NSLog
of docInteractionController.UTI I see "com.adobe.pdf" at the console, so the UTI is being recognized properly.
I can get around the "Unknown activity items" by using presentOpenInMenuFromBarButtonItem instead of presentOptionsMenuFromBarButtonItem for the UIDocumentInteractionController call, but I want to show the user the print and email options as well, not only the external app opening options.
Tested on iPad version 8.0.2. Xcode version 6.0.1, deployment target 6.0 (also tested with deployment target 8.0). All objective-c. Running on iPad version 7.1 does not produce the error.
See radar: http://openradar.appspot.com/radar?id=5800473659441152
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With