The life cycle of iOS applications is quite simple.
The two most important events are Application_Start and Application_Background.
The standard way to start an application is by clicking on its icon.
This will cause Application_Start to run. Application_Start only runs once when the process starts.
It is always the first sub to run.
You will usually load the layout in this sub and optionally restore the state.
Note that at this point the actual page size is not known.
The process will continue running until the user closes the application. This happens when the user presses on the home button.
Application_Background will be called when the application is moving to the background. This is the place to save the user data and also to save the state. You should assume that the process will be killed shortly after this sub.
Normal applications do not run in the background. There are no services in iOS.
Application_Active will be raised when the app is active. Which means that the user can interact with it. It will follow Application_Start and Application_Foreground events.
Application_Inactive will be raised when the app is still in the foreground but the user cannot interact with it. It will be raised before Application_Background. It can also be raised when there is an interruption such as a phone call. In this case Application_Inactive will be raised and if the user doesn't answer the call Application_Active will be raised.
Application_Foreground will be called after the app transitions from the background to the foreground. This event will only fire if the process was not killed while the app was in the background.
The last event is Application_OpenUrl. This event is fired when another app sends a URL to the system that your app is registered to. This is another way to start applications. This is how for example B4i-Bridge launches the apps during debugging.
The two most important events are Application_Start and Application_Background.
The standard way to start an application is by clicking on its icon.
This will cause Application_Start to run. Application_Start only runs once when the process starts.
It is always the first sub to run.
You will usually load the layout in this sub and optionally restore the state.
Note that at this point the actual page size is not known.
The process will continue running until the user closes the application. This happens when the user presses on the home button.
Application_Background will be called when the application is moving to the background. This is the place to save the user data and also to save the state. You should assume that the process will be killed shortly after this sub.
Normal applications do not run in the background. There are no services in iOS.
Application_Active will be raised when the app is active. Which means that the user can interact with it. It will follow Application_Start and Application_Foreground events.
Application_Inactive will be raised when the app is still in the foreground but the user cannot interact with it. It will be raised before Application_Background. It can also be raised when there is an interruption such as a phone call. In this case Application_Inactive will be raised and if the user doesn't answer the call Application_Active will be raised.
Application_Foreground will be called after the app transitions from the background to the foreground. This event will only fire if the process was not killed while the app was in the background.
The last event is Application_OpenUrl. This event is fired when another app sends a URL to the system that your app is registered to. This is another way to start applications. This is how for example B4i-Bridge launches the apps during debugging.