0

Background

I am trying to open some files via QuickLook. I have a .docm and a .pdf that I was able to reproduce this error with. At first I thought it was due to macro enabled Microsoft Office documents, but since I get an error with a 100+MB pdf I'm wondering if it is something wrong with QuickLook.

Error

[default] View service did terminate with error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted} #Remote

This error gets repeatedly thrown from QuickLook. From what I have seen this error seems to only be common when using a simulator and trying to send an email. I am using an iPhone 7+ and can reproduce every time.

I'm wondering if maybe the files I am using have issues with them.

Testing

I have tried the following files with varying results

  • 100MB .pdf - Success
  • 100MB .doc - Success
  • 17MB .docm - Failure
  • 85MB .docx - Success
  • 100MB .pdf - Failure (different than the first, this one loads the file but flashes it repeatedly until it goes to the "error" QuickLook screen)

Questions

Is there any size limitations or time out on QuickLook that could be causing this strange error?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
sargturner
  • 540
  • 2
  • 18
  • I'm having the same issue, see [cryptomator-ios/issues/85](https://github.com/cryptomator/cryptomator-ios/issues/85). Have you found a fix yet? Could it be an upstream bug in QLPreviewController, maybe even iOS 10.3.1 specific? – tobihagemann May 09 '17 at 09:44
  • I was not able to fix it, definitely seems like an upstream bug and looking at your open issue it seems like that is the verdict there as well! – sargturner May 09 '17 at 15:34

1 Answers1

0

Just in case if it happens in iOS12, try adding a delay when presenting quicklook controller like this -

Objective-C

 QLPreviewController *previewController = [[QLPreviewController alloc]init];
 previewController.delegate = self;
 previewController.dataSource = self;
 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)),  dispatch_get_main_queue(), ^{
     [self presentViewController:previewController animated:YES completion:nil];
 });                                                                      

Swift

let previewController = QLPreviewController()
        previewController.dataSource = self
        previewController.delegate = self
        let delay = DispatchTime.now() + 0.3
        DispatchQueue.main.asyncAfter(deadline: delay, execute: {
            self.present(previewController, animated: true)
        })

This fixed for me.

nOOb iOS
  • 1,384
  • 2
  • 19
  • 37
  • Ah I never thought of it being a controller rendering issue - if I come across this again in future work I will try it out thanks! – sargturner Dec 05 '18 at 14:25