views:

80

answers:

1

I just converted an iPhone OS 3 app to iOS 4, and once in a while, the screen will flicker and then turn black when the app returns from background mode. Has anyone else experienced this?

I finally resorted to terminating the app before it enters background mode. This is definitely a temporary band aid:

- (void)applicationDidEnterBackground:(UIApplication *)application {
   // kill the app rather than letting it go into BG
   exit(0);
}

Any advice would be great. Thanks.

+1  A: 

What is the system doing when it enters the foreground?

It sounds a lot like a memory warning may be triggering views to unload in odd ways. I'd do some testing in the simulator around firing memory warnings when in various screens.

I'm pretty sure your exit() trick would block app store submission.

Kendall Helmstetter Gelner
I can reproduce this flicker problem from several different views in my app. I've made sure that every applicable file has didReceiveMemoryWarning(), and I put a breakpoint on every single one. However, the app doesn't stop on any breakpoint when this problem occurs during debugging on the phone.I was afraid that exit() would be frowned upon. :(