しばらくの間、私はカスタムのチタン モジュールの作成に苦労しています。他のアプリで PDF を開こうとしています。すべてが正しいようです (警告などはありません) しかし、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");
}
}