app life cycle demo

demo from <<Beginning ios 5 development>>.