Page
Q2.i0S App lif cycle
Apps sophistiaated intuplay between our
custom code andl the system framuok
Systum framwork system framwork provides tha
basic infuatuchure that all
apps need to nn
Custom cocle We provide the code required to
customize that infrastuchure and qive
the app the Jook and ful that
we want.
System move OUr app fom state to stote in
rs ponse to action happeninghroughout the systun
For example when the USer presde he home buton,
a phone call comed in.
dny sUch inturpion couldoccur,andthe
state of the cumutly wnning app change in
rdponse to it
The oiffurent statel
states in which an app an be in
Lare listed a follows -
Poge
State Dueription
1.Not running The app has not bun launched, or
Akoit wa running but wCu teminated
oAL bythe system.
a.dnactive ’The
The app is runninq in the foreground,
but is currenty not reciening events
(3t may be exeeuting other code though)
henoupp usually stays in this state
only bifly as it tranitions to another
oaohstate
3.Aotive The 4pp is nning in the foreground
and is eiuing events..
This iS the nornmal mode
foreground appa.
4.Backgroung The app is in the bookgound
andexecutinq code .
Most apps enter this stuge briety
on their way to bing suspended
However on exta app that requests
extro execuion hime moy remain
in this state for a peniod of im.
In addition, Cn app being Jaunchedl
dlirectyinto he background enters
this state inAtead of the inactive
State.
Suspenda The app is in the background
but is not executing code
TRe systemn moved apps to this
State and does not notify them
before doing so
twhile suspndd, an app remaind
in mmory, but does not execute
any cocle.
When a low memory condiion
occurs ,the system may purge
without noti to
Suspended apps
make more space for the forgraund
pps.
Not running
Forground
Inachive
Active
Background
Backrourd
APP Suspendad
WFECYCLE