QLPreviewController shows a blank document after returning from background - iphone

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?

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.

Related

Corona SDK, build for iOS device works not correctly

I build my Corona app for iPhone Simulator, and it running well. But if I installed my app on my device(iPad), and i have many issues(no scrollview and tabbar working) buttons is visible only.
How to solve the problem?
Look at what happens when you run it in the iPad simulator- Do you get any errors in the console if you check it while running the app on your iPad? If so this could shed some light on the issue. One possibility is a corrupted image, or an incorrect image format.
If only the buttons are visible it sounds like you app has an error that is preventing all of the display objects from loading. (Just based on the fact you mention your buttons display but nothing else.)

iPhone simulator shows blank white screen after application launch

I am new to iPhone application development, and I am building a new calculator just to see how everything works.
I completed my code, but when I run the application, it does not show anything on the simulator.
I have created a number pad, but the screen is blank (white) after the application launches.
Can anyone give me a pointer, please?
I am using Xcode 4.2 and deployment target is 5.0
If you are using empty template for your project them make sure that you are correctly adding your view to window in appdelegate file in function named applicationDidFinishLaunching.
It can also happen when you target for iphone and using xid file related to ipad or another way.
hope it will help you and sorry for my bad english

What could cause my app to show a blank screen on startup after upgrading to iOS 4.2.1?

My app works fine on iOS 3.3, but after I upgraded my iPhone to iOS 4.2.1, I started to see some weird behaviour.
When I start my app on the upgraded iPhone, it goes blank. I have to tap the Home button to close the app.
The problem is, the app did not crash. It just showed me a blank screen. So I don't have any crash report to track this issue down.
Has anyone seen this before? Is it an iOS 4.2-specific issue? What steps can I take to determine the cause so that I can fix my code?
The behaviour of iOS did change between iOS3 and iOS4. As a first step, try walking through your code with the debugger. Also check your application:didFinishLaunchingWithOptions: method in your main App Delegate class.
A quick search also turned up some useful info about a similar issue: App shows white screen on startup after upgrading to iOS 4.2
The link also has info on how they managed to find out what was happening.

iPhone - fast-app switching and iOS 4

I'm trying to get the following functionality in my iPhone app:
When backgrounded, stays running (doesn't have to do any background work)
When resumed, app picks up where it was left off
I'm mainly wanting the same screen on my app still up, as there are several UINavigationControllers within a UITabBarController.
I have done all of the following:
Made sure I'm compiling with 4.1 SDK
Set UIApplicationExitsOnSuspend to false
Handle DidEnterBackground and WillEnterForeground in my AppDelegate
Call BeginBackgroundTask in DidEnterBackground, to attempt to keep my app open
I'm using MonoTouch, but that it probably beside the point. I can take answers in Obj-C, for sure.
I've tested my app on a jailbroken phone with Backgrounder, and I see the "app in background" badge disappear immediately after pushing the home button. I also tried setting UIBackgroundModes in my Info.plist, but to no avail.
Is there anything I'm missing?
Or is this something I would have to implement on my own to resume the previous state of my app? Everywhere I've read talks like it should just work automatically.
If you don't want to be doing work in background, don't call beginBackgroundTask. That call is for situations where you want to do some kind of work in the background. And if you don't finish that work fast enough, iOS will terminate your app.
When I upgraded to iOS 4.x, my MT application started exhibiting this behavior without me having to do anything. iOS should take care of it for you.
I finally got in touch with someone on MonoTouch's irc.
In MonoDevelop there is an option to make a dual iPad/iPhone project, which I used. This is causing my app to behave as if it's running with the 3.2 SDK when deployed to the device.
I think my solution is to install the iOS 4.2 SDK that just came out, since this ads the new multi-tasking feature on iPad.
Not only do you need to support going into the background, you also need to support cases where your app has been terminated. In your app’s initialization code, you should resume the state that it was in. For instance, when you push a view controller, use NSUserDefaults to store a value for the currently-displayed screen, and then when you start read that value and display the associated screen.

iPhone: quickly quitting an app then relaunching briefly shows last screen then black, then starts fresh

Trying to finish up an app I've been developing and have hit an odd bug that I'm not sure if it's on my end? a bug on apple's end? or perhaps the underpinnings of multitasking showing themselves.
My current app is doing this weird thing when you press the home button to quit the app, and then immediately relaunch the app. You see the Default.png image as the app starts up, but when it goes to display the window/view it briefly shows the screen as it was just before you quit the app, then goes to black for about 2 seconds and then displays the correct screen as if you were starting up fresh. I'm see this on all devices, iPods, iPhones, and iPad.
This is not just me, however, I've been trying other apps to see if they do it, and have found that the Air Hockey ( http://itunes.apple.com/us/app/air-hockey/id286106725?mt=8 ) is an example of an app that does this same thing. My instinct is that there are many apps that do. But the bulk of apps dont seem to have this issue.
I've done everything I can do make sure all views and view controllers are properly released, but it's almost like the device is taking a while to truly shut down even though the app has visually disappeared, and if you restart the app within probably 3 seconds or less then it still has something in the window buffer, or tht the full on view controller hasn't truly been released yet.
Anybody seen something like this and been able to solve it?
I'm the dev of that Air Hockey - It looks like it's probably Flurry that's causing it. I have a version without Flurry & it doesn't do it.
I solved this problem by updating my Flurry files to the latest version. http://dev.flurry.com/iphone_uploadNewVersion.do