【发布时间】:2012-12-04 11:31:14
【问题描述】:
我对@987654321@ 感到非常绝望。我唯一想做的就是将我的应用程序中的 pdf 文件与注册 PDF 的所有其他应用程序共享。
这是我的代码:
NSString * filePath = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"pdf"];
self.docController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];
self.docController.delegate = self;
NSURL *url = [NSURL fileURLWithPath:filePath];
BOOL isValid = [[UIApplication sharedApplication] canOpenURL:url];
NSLog(@"uti: %@", [self.docController UTI]);
//[self.docController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
[self.docController presentOpenInMenuFromBarButtonItem:self.backBut animated:YES];
isValid 变量始终为 TRUE,UTI 记录为 com.adobe.pdf(这似乎是正确的)但调用 presentOpenFrom... 两个调用(一个已注释)始终返回 NO。
我正在使用模拟器进行测试,是这个问题吗?是否有人发现代码有问题或知道要检查什么?
【问题讨论】:
标签: ios ios-simulator share