ApplicationDidEnterBackground vs ApplicationWillTerminate


I was trying to figure out why we were using both of these stubs and why one was for iOS 4.0+ and one of the methods was prior to 4.0. Fortunately, the stub comments explained it but I am uncertain as to what “If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.” means exactly. What is the scope or technicality behind this background execution stuff? I guess this is my “for the more curious”. :slight_smile:


This is covered in the next book “iOS Programming: The Big Nerd Ranch Guide”. (If it were a short, easy explanation, I’d stick it here. But it isn’t.)


I have the 2nd edition. can you point me to the chapter/page so i can look it up? thanks Aaron!


It is the end of chapter 15.

I guess I do have a short answer: applicationWillTerminate: only gets called on pre-4.0 devices.


Well i kinda knew that :laughing: you said as much in the book but i didn’t know why or what was going on there behind the scenes. But i will look again at chapter 15. thanks!