Note that there are some explanatory texts on larger screens.

plurals
  1. POQLPreviewController works on iOS 6; not on iOS 7
    primarykey
    data
    text
    <p>I've reviewed other posts regarding <code>QLPreviewController</code> not working under certain conditions. This one has me stymied:</p> <p><code>RHBlobCollection</code>and <code>RHBlobView</code> are model/view objects that respectively hold the collection of, and the individual displayable files, cached ahead of time.</p> <p>RHBlobView.m:</p> <pre><code> - (IBAction) handleBlobTap:(UITapGestureRecognizer *)sender { QLPreviewController *previewController = [[QLPreviewController alloc] init]; // view tag is index in array of blobs [previewController setCurrentPreviewItemIndex:self.tag]; // blobContainer is type RHBlobCollection [previewController setDataSource:self.blobContainer]; UINavigationController *navController = (UINavigationController *)[[[[UIApplication sharedApplication] delegate] window] rootViewController]; [navController pushViewController:previewController animated:YES]; } </code></pre> <p>RHBlobCollection.m:</p> <pre><code> - (NSInteger) numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller { return [self.blobs count]; } - (id &lt;QLPreviewItem&gt;) previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index { RHBlobView *blob = self.blobs[(NSUInteger) index]; NSURL *fileURL = [RHCacheManager cachedFileURLForFilename:blob.filename withKey:blob.blobID]; // URL proper? BOOL __unused proof1 = [fileURL isFileURL]; // QLPreviewController can stomach it? BOOL __unused proof2 = [QLPreviewController canPreviewItem:fileURL]; // Cached file actually exists? NSString *proof3path = [[fileURL resourceSpecifier] stringByReplacingPercentEscapesUsingEncoding:NSISOLatin1StringEncoding]; BOOL __unused proof3 = [[NSFileManager defaultManager] fileExistsAtPath:proof3path]; // Unless we're dealing with thumbnails, we're done. Return the URL of the resource. if ( ! [blob hasThumbnails] ) { return fileURL; } // Process thumbnails into .pdf file for display... </code></pre> <p><code>proof1</code>, <code>proof2</code> and <code>proof3</code> all return <code>YES</code>. Pulled out into a separate proof-of-concept project, <code>QLPreviewController</code> does as it's supposed to. In my full app project, though, it works under iOS 6 but hangs on "Loading..." with a spinner under iOS 7.</p> <p>My gut tells me that it should have something to do with a malformed file URL or path, but my little tests show everything is copasetic. Has anyone else had a problem with this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload