UIDocumentInteractionController将自定义操作添加到菜单(例如电子邮件,保存到照片)

我已经开始使用UIDocumentInteractionController为一个新的应用程序,但我想知道如何添加其他操作到您在预览屏幕上获得的操作菜单? 似乎菜单只列出已注册给定网址类型的应用程序,而且我看到PRINT出现在iOS4.2上。我想通过电子邮件添加发送并保存到照片,但没有看到扩展此菜单的方法。我可以编写我想要的动作,它只是将它们添加到菜单中似乎不可能吗? 我错过了一些明显的东西吗     
已邀请:
你是对的, 这些是方法
- (BOOL) documentInteractionController: (UIDocumentInteractionController *) controller performAction: (SEL) action


- (BOOL) documentInteractionController: (UIDocumentInteractionController *) controller canPerformAction: (SEL) action
这些方法支持的操作选择器是copy:和print:。     
要显示电子邮件和“保存到”选项,您应该使用
- (BOOL)presentOptionsMenuFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated;
要么
- (BOOL)presentOptionsMenuFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated;
如UIDocumentInteractionController.h中所述:   /这是您应该调用的默认方法,以便为您的用户提供快速查看,打开或复制文档的选项。   / 使用时   //提供一个菜单,允许用户在另一个应用程序中打开文档。
- (BOOL)presentOpenInMenuFromBarButtonItem:(UIBarButtonItem *)item animated:(BOOL)animated;
要么
- (BOOL)presentOpenInMenuFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated;
电子邮件,短信和“保存在照片/视频中”不会显示。 如果需要其他无法识别的操作,请考虑使用UIActionSheet。     
我还不能评论所以我回答了:-) 您应该尝试使用QuickLook框架。在我的情况下,我搜索了如何自定义UIDocumentInteractionController并找不到任何有用的东西。我实现了我想要的(在我的情况下,使用QuickLook在另一个视图中预览“视图”)。这是一个示例代码,将QLPreviewController作为子控制器(能够自由创建父控制器,这将在您的情况下发挥作用)。
self.previewController = [[QLPreviewController alloc]init];
self.previewController.delegate=self;
self.previewController.dataSource=self;
[self addChildViewController:self.previewController];
self.previewController.view.frame = CGRectMake(0, 0, self.previewView.frame.size.width, self.previewView.frame.size.height);
[self.previewView addSubview:self.previewController.view];
[self.previewController didMoveToParentViewController:self];
您还需要一些代理:QLPreviewControllerDataSource和QLPreviewControllerDelegate 还有一些需要实施:
- (id <QLPreviewItem>)previewController: (QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
将NSURL返回给资源
- (NSInteger) numberOfPreviewItemsInPreviewController: (QLPreviewController *) controller
返回要预览的项目数(在我的情况下,1)     
我可以建议一个简单的UIActionSheet或更好的popover,如果你在iPad上与应用程序的表视图内,你可以手动添加打印,电子邮件和其他一切。     

要回复问题请先登录注册