You will need the UIDocumentInteractionController class.
It is available in UIKit, so you do not need a specific infrastructure for this.
You create an instance of this class using the URL of the file you want to transfer to another application that can handle the file type:
UIDocumentInteractionController * controller; controller = [ UIDocumentInteractionController interactionControllerWithURL: someFileURL ];
Then you can submit it:
[ controller presentOpenInMenuFromRect: someRect inView: someView animated: YES ]
Please note that on the iPad you will need to save the controller, otherwise it will be released, which will lead to the crash of the application.
This method returns a BOOL value. NO returned if an application for the file type was found. In this case, you can display a warning.
Macmade
source share