Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6018987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:21:18+00:00 2026-05-23T03:21:18+00:00

Apple’s documentation recommends installing a keep-alive handler in the applicationDidEnterBackground: method. It also says

  • 0

Apple’s documentation recommends installing a keep-alive handler in the applicationDidEnterBackground: method. It also says that the new handler replaces the previously installed one.

So my question is, why do they recommend installing it in applicationDidEnterBackground? Do I have to install this handler every time the application enters background? In other words, is the handler discarded every time you enter foreground, so you have to re-install it every time you enter background?

If not, is there a more appropriate place to install this handler?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:21:19+00:00Added an answer on May 23, 2026 at 3:21 am

    I can hazard a guess – there are a number of conceivable scenarios where you may want to change the handler depending on user settings or application behaviour. In that case, it makes the most sense to set it up in applicationDidEnterBackground. There is perhaps also something to be said for plain consistency between applications and codebases.

    But you can certainly install your keep-alive handler elsewhere in your app, and it shouldn’t (to my knowledge) be discarded upon entering the foreground again. However, keep-alive handlers are discarded upon application termination.

    Since all that call actually does is basically set a few variables, there’s no real performance penalty to calling it in applicationDidEnterBackground, so it won’t disrupt the process of pushing an app to the background.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Apple says that there is a visibleRect method on the mac ( Source ),
Apple's documentation for UIDocumentInteractionController presentOpenInMenuFromBarButtonItem:animated: method states that If there are no registered apps
The Apple Developer Documentation (link is dead now) explains that if you place a
Apple says, that in Cocoa -dealloc will not be called neccessarily when the application
Apple says that this is a good idea for saving memory. What would that
Apple's guidelines for their new Mac App Store say that you cannot use deprecated
I know the Apple documentation has the following delegate method: - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; //
Apple strongly recommends using the binary plist format when reading large XML-based data sets
In the Apple documentation for NSRunLoop there is sample code demonstrating suspending execution while
I have read the Apple documentation. They list the apps registered, yet in their

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.