Saturday, December 24, 2011

A paragraph about iOS Application Life Cycle


In iOS,specifically in developing for iPhone, it is very important for an application to have proper handler methods for different states that the application may go to. This is because of the fact that in iPhone, the likelihood of your application going to background is reasonably high. This can be due to a phone call, SMS, alarms or even user pressing the home button. There are few matters that should be particularly considered when thinking about your application life cycle. For instance:
  • Applications that use OpenGL in the background will be terminated by iOS.
  • Although networking operations can easily continue to operate in background, special considerations similar to those of concurrency are required.
  • Timers and other periodical tasks should stop functioning.
  • No new task should be initiated.
To handle situations mentioned above, the application object informs its delegate of changes in application state. To provide more flexibility, it also sends notifications about each change to let other interested parts of the program know about the state transition so that they can take action independently if necessary. Basically the changes in application state are application did finish launching, application did become active, application will resign active, application did enter background, application will enter foreground and application will terminate.

No comments:

Post a Comment