Search code examples
iphoneobjective-ciosnsnotificationsuiapplication

Differentiate between application launch and application awake


I need to be able to differentiate between application didFinishLaunching and application entering background and being loaded back into the foreground. I noticed that if I register for the UIApplicationDidBecomeActiveNotification, it is called in both instances. How do I distinguish between the two?


Solution

  • I need to be able to differentiate between application didFinishLaunching

    UIApplicationDidFinishLaunchingNotification
    

    application entering background

    UIApplicationDidEnterBackgroundNotification
    

    being loaded back into the foreground

    UIApplicationWillEnterForegroundNotification