0

私は自分のアプリで iBooks ライブラリの PDF ファイルを開こうとしている Objective-C 初心者です。

次のコードを使用します - 開いているダイアログを作成しているように見えますが、エラーが発生します - 「ウィンドウのないビューからポップオーバーを表示できません。」これを修正する方法がわかりません...ここで何が間違っていますか?

- (void) showOptionsMenu
{
    NSURL *fileURL = [NSURL fileURLWithPath:@"ibooks://test.pdf"];
    docController = [self setupControllerWithURL:fileURL usingDelegate:self];
    bool didShow = [docController presentOptionsMenuFromBarButtonItem:self.toolbarItems[0] animated:YES];
    if(!didShow)
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Sorry, app not found" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert show];
    }   
}
4

1 に答える 1

0

私のUIDocumentInteractionControllerのプロパティを宣言することで問題を解決しました。

于 2013-04-04T15:43:52.983 に答える