qlpreviewcontroller

QLPreviewController crashing when tapping share button, internal consistency nib bundle error

戏子无情 提交于 2019-12-11 01:36:33
问题 I'm presenting a QLPreviewController modally. Everything works-- it pops up, shows the preview item and everything. However, once the share button is tapped, the app crashes on the device and in the simulator with this: 2013-05-03 20:10:53.563 appname[16860:c07] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle <{{app_path}}> (loaded)' with name '_UIDocumentActivityViewController'' Here is the relevant code:

blank QLPreviewController in iOS application

帅比萌擦擦* 提交于 2019-12-10 03:10:35
问题 I am trying to display a file using QLPreviewController. The QL view displays correctly (is pushed on top of my Navigation Controller) but the content is blank. However, no errors are displayed and application doesn't crash. Checks on existence of file return true. (A proof is that if I use [self.docInteractionController presentPreviewAnimated:YES]; where docInteractionController is a UIDocumentInteractionController the file is correctly shown). The code is taken directly from Apple sample

Generate document thumbnails

不打扰是莪最后的温柔 提交于 2019-12-09 13:56:18
问题 I am trying to display a grid of documents (saved in the documents directory) but I don't know how to generate the thumbnails for the documents. The documents can be anything that a QLPreviewController can display. PDF's and Images are fine to do but other things like .doc's I don't know about. Any guidance would help. 回答1: Since you have an UIView that can display any of this documents you could just take a shortcut: -Create an instance of your preview controller with displayed document -Do

How to customize the color of the navigation bar in qlpreviewcontroller

天大地大妈咪最大 提交于 2019-12-08 16:23:21
问题 Can I customize the color of the navigation bar in the QlPreviewController controller? I have tried following [[UINavigationBar appearanceWhenContainedIn: [QLPreviewController class], nil] setBarTintColor: [UIColor redColor]]; but it does not work. Thanks. 回答1: Yeah, there is a bug with barTintColor on QLPreviewController for iOS 11 if you are showing it via presentViewController: animated: Here's my solution, use setBackgroundImage: with 1x1 image instead of setBarTintColor: [

QLPreviewController delegate method doesn't get called in iOS 10, but does get called if ran earlier than iOS 10

痞子三分冷 提交于 2019-12-08 14:15:50
问题 Here is my code. This may sound like redundant question but my scenario is different as I am not adding QLPreviewController as a subview but present as a controller. After downloading from dropbox, I present it like- self.pdfViewController = [[QLPreviewController alloc] init]; self.pdfViewController.delegate = self; self.pdfViewController.dataSource = self; [self presentViewController:self.pdfViewController animated:YES completion:nil]; and I also have QLPreviewControllerDataSource,

QLPreviewController - setting previewItemTitle

时光总嘲笑我的痴心妄想 提交于 2019-12-07 11:24:20
问题 I can't work out how to set the previewItemTitle property for my QLPreviewController class. Its seems a bit strange as the iPhone developer document for this class says that that property is @property (readonly) which would mean that I cannot set it. Any ideas. Thanks My code: QLPreviewController *preview = [[QLPreviewController alloc] init]; [preview setDataSource:self]; [self presentModalViewController:preview animated:YES]; 回答1: QLPreviewController has no previewItemTitle property. You

Intercepting PDF Link Clicks using Quicklook Framework (QLPreviewController)

喜你入骨 提交于 2019-12-07 08:43:10
问题 Is PDF Link handling available in Quicklook? I created a prototype, and the QLPreviewControllerDelegate method -(BOOL)previewController:(QLPreviewController *)controller shouldOpenURL:(NSURL *)url forPreviewItem:(id)item never gets called. When I use a .docx file with links in it, the delegate method does get fired. Also, when I open up the PDF using safari, or a UIWebView, link handling works fine. I tested with a few different PDFs, and link interception never worked. I made sure that My

iOS 6.0 Quicklook QLPreviewController errors with: “Cannot find preview item for loaded proxy”

大憨熊 提交于 2019-12-07 02:09:18
问题 My application has been using the QLPreviewController to display files of all types and in iOS 5.x , it seemed to do so just fine. Now, in iOS 6.0, I get an error and it shows the controller but with a constant loading indicator and never actually loads anything. The error in the log is: Cannot find preview item for loaded proxy: <QLPreviewItemProxy: 0x8dbf480> - file://localhost/Users/me/Library/Application%20Support/iPhone%20Simulator/6.0/Applications/E6A58F8D-71F3-4C7A-B16E-4BA017E318E5

QLPreviewController hide bottom toolbar

≯℡__Kan透↙ 提交于 2019-12-04 17:09:59
I use QLPreviewController in my app and want to hide bottom toolbar which allows to move through it's datasource items. Is it possible to do somehow? I tried to search it as a subview of QLPreviewController's view but it has only one subview of _UISizeTrackingView class . As i understand it's a private class so i have no rights to look for something there. Are there any ways to hide this toolbar and does Apple allow to make that? Thank you. QLPreviewViewController can have more than 1 toolbar inside. That's why you need to find all UIToolbar in subviews and hide them. Also you need observe

Generate document thumbnails

不羁的心 提交于 2019-12-03 21:54:06
I am trying to display a grid of documents (saved in the documents directory) but I don't know how to generate the thumbnails for the documents. The documents can be anything that a QLPreviewController can display. PDF's and Images are fine to do but other things like .doc's I don't know about. Any guidance would help. Since you have an UIView that can display any of this documents you could just take a shortcut: -Create an instance of your preview controller with displayed document -Do not add this view/controller to anything -Create image from its layer This might help: + (UIImage *