You need to download the items yourself and then pass file URLs to the preview controller. The preview controller only deals with the display and user interaction for you.
How can I use QLPreviewController in iOS to display image or file using http address?
-
04-06-2022 - |
Question
I' m trying to use QLPreviewController
to display files located in the web by http address.
For example I want it to display image located here: http://iosdevelopertips.com/wp-content/uploads/2011/05/preview.jpg
In previewItemAtIndex
I did this:
NSString* url = @"http://iosdevelopertips.com/wp-content/uploads/2011/05/preview.jpg";
return [NSURL URLWithString: url];
But when I click on the image in my tableview it appears Loading...
indicator of the QLPreviewController
which is rotating endlessly and in the log I see this message:Couldn't issue file extension for path: /wp-content/uploads/2011/05/preview.jpg
So the question how can I display files in QLPreviewController
located in the web using http
address in NSURL
? What am I doing wrong? Thanks.
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow