Некоторое время я пытаюсь создать собственный титановый модуль.Я пытаюсь открыть PDF-файл в другом приложении.Кажется, все правильно (без предупреждений и т. Д.) Но при нажатии кнопки в de navBar меню не отображается.
Вот код метода, отображающего меню:
ENSURE_SINGLE_ARG_OR_NIL(args,NSDictionary);
TiViewProxy* viewAnchor = [args objectForKey:@"view"];
NSString* fileToOpen = [args objectForKey:@"url"];
NSLog(@"%@",fileToOpen);
if(viewAnchor != nil){
NSLog(@"viewAnchor is not nil accessing controller");
NSLog(@"%@",[TiUtils toURL:fileToOpen proxy:self]);
CGRect rect = [TiUtils rectValue:args];
self.controller = [[UIDocumentInteractionController interactionControllerWithURL:[TiUtils toURL:fileToOpen proxy:self]] retain];
self.controller.delegate = self;
BOOL menuDisplayed = [self.controller presentOpenInMenuFromBarButtonItem:[viewAnchor barButtonItem] animated:YES];
//menuDisplayed = YES
if(menuDisplayed)
{
NSLog(@"Menu is displayed");
//This display's com.adobe.pdf
NSLog(@"%@",self.controller.UTI);
}
else
{
NSLog(@"Menu failed to display");
}
}