Homepwner app locks up


Ran into quirky behavior after adding the initial load/save to the Homepwner app after adding the changes (up to the top of page 209). If I launch the app in the debugger, exit to the multitask bar, then kill it for good, when I relaunch, the application locks up. That is, it does not respond to input. If I then try to kill it from the multitask bar, I get a completely black screen. It acts the same way on the simulator or on hardware (iPhone 4 in my case) for debug builds.

Here are the steps:

  1. Launch the app from Xcode in debug mode. It works fine.
  2. Exit to multitask bar, then kill it from the multitask bar.
  3. Relaunch app. It locks up.
  4. Exit to multitask bar, then kill it from the multitask bar.
  5. Screen turns black; can’t see any app icons. Pulling up the multitask bar shows an animated gray line over the black screen.

Any ideas on what could cause this? I’ve tried setting breakpoints, but I can’t find where it’s failing. I’ve reviewed the code in Chapter 14 line by line and can’t see any errors. I have implemented applicationDidEnterBackground method as stated in the iOS 4.0 sticky.

Now if I deploy to the hardware with a Release build, it doesn’t do that. So I guess it’s not a huge deal, but it was surprising.



No help here, but I just wanted to confirm that the exact same thing with the screen turning black happens to me as well. I’d be interested in what the fix is.



See https://devforums.apple.com/message/248322#248322 for others with similar problems.

I think it’s a bug in iOS4.

You can stop the app from running in the background by setting the “Application does not run in background” entry in the application plist.

This will trigger applicationWillTerminate on exit and not applicationDidEnterBackground.



This is a bug in iOS 4. As far as I can tell, it only happens with applications you have installed via Xcode. Opting out of multitasking can fix the issue, but in my experience, once the bug has hit, you’ll need to 1) wipe the app from your phone 2) restart phone 3) clean build product 4) reinstall with opt out specified in Info.plist.

It is a rather obnoxious bug. File a bug report if you have useful information on how you got to the bug: bugreport.apple.com