views:

74

answers:

1

I learnt that to pause and resume my app (due to interruptions) i have to use the application delegate method "applicationWillResignActive" . But am not clear of the statements within this function. can anyone explain as to what should be enclosed in this method?

+1  A: 

You provide the method. It gets called if the iPhone is locked, among other reasons. When you get this method call, you do whatever is necessary to freeze your app. For example, if a game is being played, you might want to pause it. If you are playing music, you might actually want to do nothing, but continue to play the music, since the user can still hear it even with the screen locked. If you are playing a movie, then you might want to pause it.

It is up to you what is enclosed in this method. If your app can do something useful while the screen is locked, then continue whatever you were doing. If not, then pause the various elements like GUI animation or sounds until the app is reactivated.

mahboudz