Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I call a function immediately upon an iPhone app resuming from a saved state?

  1. User has my app open.
  2. They hit the home button, resulting in my app closing and going into a "saved state".
  3. Users uses his device for other things.
  4. User opens up my app again, resuming from where he left off.

How, in my code, do I detect that the user has resumed from the saved state? Is there a specific iOS4 multitasking NSNotification that I can attach to?

like image 378
Ethan Allen Avatar asked Feb 24 '23 04:02

Ethan Allen


1 Answers

Implement applicationDidBecomeActive: in your app delegate.

See also:

  • applicationWillEnterForeground vs. applicationDidBecomeActive, applicationWillResignActive vs. applicationDidEnterBackground
  • Handling applicationDidBecomeActive - "How can a view controller respond to the app becoming Active?"
like image 107
John Lemberger Avatar answered Mar 05 '23 16:03

John Lemberger