Ios QLViewController显示PDF文件,但“活动”视图显示为空。没有列出任何应用程序
我有一个下载pdf文件的应用程序,然后使用QLViewController显示。点击顶部栏中的“共享”按钮将显示一个空的活动视图。它应该包含“打印”、“在iBooks中打开”等内容 截图: 如果我通过XCode运行我的应用程序,一切都正常,但是如果我创建一个临时构建,我会得到屏幕截图中显示的空菜单。下面是我的代码:Ios QLViewController显示PDF文件,但“活动”视图显示为空。没有列出任何应用程序,ios,objective-c,pdf,qlpreviewcontroller,uiactivityviewcontroller,Ios,Objective C,Pdf,Qlpreviewcontroller,Uiactivityviewcontroller,我有一个下载pdf文件的应用程序,然后使用QLViewController显示。点击顶部栏中的“共享”按钮将显示一个空的活动视图。它应该包含“打印”、“在iBooks中打开”等内容 截图: 如果我通过XCode运行我的应用程序,一切都正常,但是如果我创建一个临时构建,我会得到屏幕截图中显示的空菜单。下面是我的代码: - (void) DisplayFileWorker: (const wchar_t*) fileName { iOSClient_AppDelegate *appDeleg
- (void) DisplayFileWorker: (const wchar_t*) fileName
{
iOSClient_AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
QLPreviewController *previewController = [[QLPreviewController alloc]init];
previewController.delegate = appDelegate.serverViewController;
previewController.dataSource = appDelegate.serverViewController;
previewController.currentPreviewItemIndex = 0;
NSString* filePath = [[NSString alloc] initWithBytes: (const void*)fileName
length: wcslen(fileName) * sizeof(*fileName)
encoding: NSUTF32LittleEndianStringEncoding];
appDelegate.serverViewController.previewFile = filePath;
[appDelegate.serverViewController presentModalViewController:previewController animated:YES];
[previewController release];
}
我尝试过将文件复制到其他地方,更改文件的权限,将pdf文件添加到资源中,我总是得到相同的空白菜单。有什么想法吗?文件的扩展名是什么?filePath变量在调试器中显示了什么?