Skip to content
C# Corner
Searcharticlesvideosblogsforumsinterview questionsarticles
  • Tech
  • Articles
  • Blogs
  • News
  • Videos
  • Interviews
  • Forums
  • Books
  • Events
    • Jobs
    • Stories
LoginRegister
  • Article
  • Blog
  • Video
  • Ebook
  • Interview Question
Loading
Upcoming Events
View all
  • 23 NOV
    AI Agents Conference 2026 - 3rd Edition

Our Training Programs

View all
  • AI & Machine Learning

  • Mastering Large Language Models

  • Mastering Prompt Engineering

  • Certified Vibe Coder

  • Github Copilot Training

  • Generative AI for Beginners

  • n8n Automation & AI Agents Training

About UsContact UsPrivacy PolicyTermsBrand GuidelinesPartnersC# TutorialsConsultantsIdeasReport A BugFAQsSitemapStoriesCSharp TVDB TalksWeb3 UniverseJumpstart Blockchain

©2026 C# Corner.

All contents are copyright of their authors.

App States in iPhone
  1. Home
  2. Technologies
  3. Learn iOS Programming
  4. App States in iPhone
Learn iOS Programming

App States in iPhone

Sachin Bhardwaj

Sachin Bhardwaj

13yPublished Feb 2, 2013, 12:00 AMUpdated Feb 7, 2013, 2:38 PM4k00

Reactions

100Article
iPhoneXcodeiPhone States

Comments

Join the conversation! Your thoughts help the community grow.

Sign in to leave a comment.

    Notrunning State: The app has not been launched or was running but was terminated by the system.

    Inactivestate: The app is running in the foreground but is currently not receiving events. (It may be executing other code though.) An app usually stays in this state only briefly as it transitions to a different state. The only time it stays inactive for any period of time is when the user locks the screen or the system prompts the user to respond to some event, such as an incoming phone call or SMS message.

    Activestate: The app is running in the foreground and is receiving events. This is the normal mode for foreground apps.

    Backgroundstate: The app is in the background and executing code. Most apps enter this state briefly on their way to being suspended. However, an app that requests extra execution time may remain in this state for a period of time. In addition, an app being launched directly into the background enters this state instead of the inactive state. For information about how to execute code while in the background, see "Background Execution and Multitasking."

    Suspendedstate: The app is in the background but is not executing code. The system moves apps to this state automatically and does not notify them before doing so. While suspended, an app remains in memory but does not execute any code. When a low-memory condition occurs, the system may purge suspended apps without notice to make more space for the foreground app.

    - (void)applicationDidEnterBackground:(UIApplication *)application

    {

    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.

    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

    }

    - (void)applicationWillEnterForeground:(UIApplication *)application

    {

    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

    }

    - (void)applicationDidBecomeActive:(UIApplication *)application

    {

    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.

    }

    - (void)applicationWillTerminate:(UIApplication *)application

    {

    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.

    }