这可能吗?我在下面尝试了这段代码,但无法编译:
- (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 上崩溃,因为它不是属性。
有任何想法吗?