84

Can anyone explain what is the life cycle process of iPhone? i.e from the start to end of the application life cycle.

Ahmad F
  • 30,560
  • 17
  • 97
  • 143
Santusura8
  • 869
  • 1
  • 7
  • 5
  • I had found an article which has gud explanation abt the app life cycle, please refer to the below doc. I hope it will be helpful others. http://www.codeproject.com/KB/iPhone/ApplicationLifeCycle.aspx – Santusura8 Jun 29 '11 at 11:48
  • http://www.codeproject.com/Articles/121681/Application-s-Life-Cycle-in-iOS4 – Anand Jul 09 '12 at 13:50

4 Answers4

125

See also This post on Cocoanetics that present a very useful flowchart explaining the different calls to the AppDelegate methods during the app life cycle:

UIApplication Delegate messaging flowchart

AliSoftware
  • 32,623
  • 6
  • 82
  • 77
  • Is this still valid for ios5? – James Mertz Jun 19 '12 at 07:23
  • @KronoS - Yes, the only time this changed significantly was the introduction of multitasking in iOS 4.0. It's still viable as of iOS 5.0 (and should continue to be so for iOS 6.0). – Brad Larson Jul 09 '12 at 14:47
  • 1
    Apple/iOS does not send the `applicationWillTerminate` message. About all you will get is a `SIGTRM` when the operating system wants you out of memory. The docs have been broken for years. – jww Oct 10 '13 at 15:17
  • iOS does send the `applicationWillTerminale` message, but only in the cases explained in the diagram, namely if you were compiling with SDK<4 (which can't be the case nowadays) or if you set `UIApplicationExitsOnSuspend` to `YES` in your app's `Info.plist`. So the diagram is still right ;) – AliSoftware Oct 10 '13 at 21:01
115

here is diagram image for understand Life Cycle (iPhone / Android)

enter image description here


Edit: Here is the more detailed information from Apple Docs.

Part 1:

enter image description here

Part 2:

enter image description here

Reference

Also this one is for View Controller Life Cycle methods

enter image description here

swiftBoy
  • 35,607
  • 26
  • 136
  • 135
  • is there a diagram like this but using the applicationDid|Will methods? – Keale Sep 03 '13 at 09:25
  • @Keale please check [this official](https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html) page have all the information with diagrams. – swiftBoy Nov 14 '13 at 08:32
  • The Apple reference links are broken. Here are updated ones: [The App Life Cycle](https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html#//apple_ref/doc/uid/TP40007072-CH2-SW1) and [The Launch Cycle](https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforHandlingAppStateTransitions/StrategiesforHandlingAppStateTransitions.html#//apple_ref/doc/uid/TP40007072-CH8-SW3) – rmp251 Oct 12 '17 at 15:50
20

There's another simpler one in ios developer's cookbook

enter image description here

Haider
  • 4,961
  • 2
  • 18
  • 25
2

If you want to something more detail ,you can read the official document delivered by apple
It has been updated with iOS6.0
http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ViewLoadingandUnloading/ViewLoadingandUnloading.html

andyqee
  • 3,175
  • 3
  • 21
  • 24
  • The App Life Cycle Updated with iOS 9 : https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html – samira riazati Oct 10 '15 at 07:45