tags:

views:

239

answers:

2

Hi Guys,

I have upgraded my iPhone SDK from 3.1.2 to 4. The application which I developed in previous version is running fine but I have only one problem.

When I close the application it is not calling application termination and deallocating anything. When I click home button application quits but when I open it again it opens exactly where I left it.

Does anyone else had this issue if yes how did you solve that?

Thanks

+1  A: 

At a guess, I'd say that your application is not terminating, but is staying present in the background. It will be terminated when memory becomes scarce in the same way as it would be terminated in the 3.x days.

Petesh
+4  A: 

What you are seeing is the state-saving multitasking that all sdk4 apps do. It isn't calling those methods because you app is not terminating, iOS is just saving the state and pushing it to the background. If you notice, the debugger doesn't unhook when you hit the home button now either. If you look into the new sdk documentation, there are methods when you app enters the background, which sound like the place you want to move the code that was in your 'willTerminate' method.

Edit: Here is the documentation for those methods

applicationDidEnterBackground:

applicationWillResignActive:

ACBurk
Does that mean that I should leave it as it is and it is multitasking ready. Another quick one, How can user quit an application if he really wants to?
Leo
Apple suggests that you do all your clean up and saving stuff that used to be in your willTerminate whenever your app enters the background since your app can be closed at anytime (if the device gets low on memory). But yes, as it is, anything that is compiled with the 4.0 sdk is multitasking (state-saving) ready,.Users aren't really supposed to think about having to close your app manually, However if your curious, you double click the home button, hold on one of the icons, then click the red minus sign.
ACBurk
Great stuff. All clear now:)
Leo
Can you accept this answer then?
ACBurk