Code:
-(NSURL*)loadDocument:(NSString*)docName docExtension:(NSString*)docExt
{
NSString *path = [[NSBundle mainBundle] pathForResource:docName ofType:docExt];
return [NSURL fileURLWithPath:path];
}
Code:
- (IBAction)toolbarActionButtonPressed:(id)sender {
UIDocumentInteractionController *dIController = [UIDocumentInteractionController interactionControllerWithURL:[self loadDocument:[currentContent objectForKey:@"docName"] docExtension:[currentContent objectForKey:@"docExtension"]]];
[dIController presentOpenInMenuFromBarButtonItem:sender animated:YES];
}
When pressing the toolbarActionButton, an action sheet presents with 1 or more buttons, depending on the device the app is running on (and if apps that support the document are installed). For instance, on my primary device, options to open in iBooks, Adobe Reader, and the Kindle App appear.
However, when I select any of these action sheet index buttons, the action sheet dismisses and nothing happens.
Which delegate method do I need to implement to get this working? I understand that the following delegate method is a likely candidate, but how do I call the application identifiers?
Code:
- (void) documentInteractionController: (UIDocumentInteractionController *) controller willBeginSendingToApplication: (NSString *) application {
}