我正在尝试将“presentOpenInMenuFromRect”功能添加到 Rhomobile。但是,我无法引用当前视图。
Rhomobile 功能(### 标记我的补充):
- (void)openDocInteractCommand:(NSString*)url {
if (NSClassFromString(@"UIDocumentInteractionController")) {
NSURL *fileURL = [NSURL fileURLWithPath:url];
UIDocumentInteractionController* docController = [UIDocumentInteractionController interactionControllerWithURL:fileURL];
docController.delegate = self;//[AppManager instance];
BOOL result = [docController presentPreviewAnimated:YES];
if (!result) {
###
BOOL isValid = [docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
###
}
}
}
本质上,如果预览失败,我想打开“打开方式”菜单,因为我正在尝试打开一个 .KMZ(Google 地球 KML 文件)并且它不能是预览。
完整源代码:https ://github.com/rhomobile/rhodes/blob/master/platform/iphone/Classes/AppManager/AppManager.m
谢谢,
缺口,