applicationWillTerminate vs. applicationDidEnterBackground


#1

Hi All,

I am writing the examples in the book using the new 4.0 iPhone OS - and it seems to me that one of the things that are relatively new is that applications can go to the background instead of actually being terminated. That’s what was happening in the simulator.

So I copied the code that was in applicationWillTerminate and and put it in applicationDidEnterBackground.

My question then - is it the proper thing to do to have the same code in both applicationWillTerminate and applicationDidEnterBackground?

Thanks,
Mazen


#2

Yes, it is.


#3

why not just create a method containing the code you’re duplicating then call it from both applicationWillTerminate and applicationDidEnterBackground?


#4

that’s what I did.
I don’t know why but my app never goes through ApplicationWillTerminate but goes in background. I’m using the simulator