使用URL参考方案打开主题演讲,触摸uibutton

时间:2013-02-21 18:51:27

标签: ios objective-c ipad properties keynote

这可能吗?我已经尝试过以下代码,但我无法编译:

- (IBAction)KeynoteButton:(id)sender {

    UIDocumentInteractionController *controller = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:@"2bm iPad presentation.key"]];
    self.controller.delegate = self;
    CGRect navRect = self.view.frame;
    [self.controller presentOptionsMenuFromRect:navRect inView:self.view animated:YES];
}

#pragma mark - UIDocumentInteractionControllerDelegate

//===================================================================
- (UIViewController *)documentInteractionControllerViewControllerForPreview:(UIDocumentInteractionController *)controller
{
    return self;
}

- (UIView *)documentInteractionControllerViewForPreview:(UIDocumentInteractionController *)controller
{
    return self.view;
}

- (CGRect)documentInteractionControllerRectForPreview:(UIDocumentInteractionController *)controller
{
    return self.view.frame;
}

它在self.controller上崩溃,因为它不是属性。

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我认为你需要拿出“自我”。由于控制器是局部变量。