1
votes

I am having an issue with QLPreviewController on XCode 4.2 iOS SDK 5.0. I run my code on iPod Touch running iOS 4.3.3. Basically my app uses QLPreviewController to preview PDF files in Documents directory and if the app resigns active, the next time it becomes active it will require a user to enter 4-digit PIN number. The app runs fine in general, previewing PDF files with no problem at all. The problem I'm facing is that QLPreviewController shows a blank screen after the app returns from background (and of course after a correct PIN has been entered).

I have the screenshots below. The one before going to background is http://www.mediafire.com/i/?vxdmrx5mjxrwglp and the one after returning from background is http://www.mediafire.com/i/?jhdmavzvccj0f2q

Please note that the source PDF file is not modified at all, and I did call both refreshCurrentPreviewItem and reloadData methods in viewDidAppear.

Similar problems on iPhone Simulator running 4.3.2. However, this problem does not occur on iOS 5.

Does anyone ever experience this issue? Any comments or workaround would be much appreciated.

Thanks

PS. It is strange that when the application goes to background, the delegate previewControllerDidDismiss: is fired on iOS 4. On iOS 5, this does not happen. Perhaps this is the reason of the blank screen. Any thought? Any workaround?

1

1 Answers

0
votes

I had an issue on iOS 5.1 where the custom button I had on the Quicklook toolbar disappeared when coming back from the background. I fixed it by using an NSNotifcation for when the app became active again and the Quicklook controller listened for it and re-updated the navigation button.

I assume something similar could be done with reloading the document.