Question

I have tabbar-based application. When I put in my plist UIBackgroundModes (my application is supposed to support voip), the GUI doesn't load. It sucks on Splash screen and doesn't load the first tab view. When i remove the UIBackgroundModes property from info.plist, it works fine. More than that, pressing the home button when it stuck does nothing. Did somebody encountered a similar problem? (The problem exists on simulator)

Thanks,

Nava

Was it helpful?

Solution

It appears, that the problem happens on Simulator only, it works on the device... So the solution (temporary one) is not to put UIBackgroundModes into info.plist for simulator version.

OTHER TIPS

You are responsible for loading/unloading the interface when going in and out of the background mode. You'll also need to update the interface accordingly when coming out of background.

iOS helps a bit by taking a screenshot before putting the app in background and displaying it when getting the app to foreground (a bit like Default.png when starting the app) and also some UIImage caching.

It might be worth sharing some code.

Supporting Background State Transitions
Supporting the background state transition is part of the fundamental architecture for applications in iOS 4 and later. Although technically the only thing you have to do to support this capability is link against iOS 4 and later, properly supporting it requires some additional work. Specifically, your application delegate should implement the following methods and implement appropriate behaviors in each of them:

  • application:didFinishLaunchingWithOptions:
  • applicationDidBecomeActive:
  • applicationWillResignActive:
  • applicationDidEnterBackground:
  • applicationWillEnterForeground:
  • applicationWillTerminate:

Being a Responsible, Multitasking-Aware Application
Applications that run in the background are more limited in what they can do than a foreground application. And even if your application does not run in the background, there are are certain guidelines you should follow when implementing your application.

  • Do not make any OpenGL ES calls from your code. You must not create an EAGLContext object or issue any OpenGL ES drawing commands of any kind. Using these calls will cause your application to be terminated immediately.
  • [...]

iOS Application Programming Guide

I see this bug as well. It's very annoying. It's as if the app is stuck in the simulator and won't keep going. When this happens, I know how to "unstick" it.

In the simulator I just go to menu Hardware > Lock and then unlock the phone again. Now I stop the debugger and start the app again. This seems to kick it back to life.

Fortunately this bug doesn't happen on a real phone, only in the simulator.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top