IOS4 messes up saving and loading


I just went through a very strange debugging experience. With the upgrade it IOS4, when you “end” an application, it doesn’t really end; it enters background operation and is eventually suspended.

That’s all fine and good, except I’ve noticed two things:

First, when you hit the “home” button while the debugger/xcode is running an application, the application doesn’t really end in xcode; and second, unless you implement applicationDidEnterBackground:application in HomepwnerAppDelegate, the methods to save the data never actually get implemented.

So, while it’s cool to be able to run (and have IOS eventually suspend) an application in the background, I think it’s important to put out there that small changes to the implementation are needed to make data actually get saved properly.

in Homepwner, my implementation in HomepwnerAppDelegate is very simple:

- (void)applicationDidEnterBackground:(UIApplication *)application { [self applicationWillTerminate:application]; }

The other change I made is a personal preference one: I added a line to the Homepwner-plist file:

Application does not run in background and then checked the checkbox. That ensures that when the home button gets pressed, or when application is interrupted, it saves the data and terminates, rather than enters the background. I don’t think that’s as critical as the code change I noted above, but it’s convenient.

Unless anyone else has some thoughts…


This note along with a few others highlighting iOS4 differences are also covered in Joe’s iOS update announcement for this forum: viewtopic.php?f=9&t=431

However I haven’t seen mention before of the note about being able to configure an application so that the os won’t run it in the background.


Ah, geez!

Talk about missing the blatantly obvious! FacePalm.