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 8526923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:24:36+00:00 2026-06-11T08:24:36+00:00

I am developing an iOS application where need to do some stuff when I

  • 0

I am developing an iOS application where need to do some stuff when I have Internet connection and other, when I haven’t. If I haven’t at some point I will show a message to the user to give me internet and come back. The question it is how to detect the following situation:

  • the user press the Home button twice, goes to multitasking , Settings and will connect to internet
  • the user comes back with multitasking to my app, but doesn’t press anything

I know I will get callbacks to the AppDelegate:

- (void)applicationDidEnterBackground:(UIApplication *)application
- (void) applicationDidBecomeActive:(UIApplication *)application

but the code ( it is not started by me) it is very big, and I don’t want to handle there the UIViewController needs, if there is any alternative.

My UIViewController’s – (void)viewDidAppear:(BOOL)animated it isn’t called when the user came back.

screenshot

The breakpoint it is not hited for sure!

Any usable ideas, except in AppDelegate?

  • 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-06-11T08:24:37+00:00Added an answer on June 11, 2026 at 8:24 am

    You can use the notification center to listen to applicationDidEnterBackground within the view controller:

    [[NSNotificationCenter defaultCenter] addObserver: self
                                          selector: @selector(handleEnteredBackground:) 
                                          name: UIApplicationDidEnterBackgroundNotification
                                          object: nil];
    

    Do this in viewDidLoad. Similarily for applicationDidBecomeActive.

    Don’t forget to remove yourself as an observer in viewDidUnload.

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

Sidebar

Related Questions

I have been developing some iOs stuff using the simulator and a real iPad.
I'm developing an iOS 4 application. I have this ViewController: @interface BlogViewController : UIViewController
I'm developing an iOS 4 application. I have a main view that contains another
I am developing a PhoneGap application for Android (will work on iOS too). The
I'm developing an iOS application that will be used just by a company employees
I'm developing an iOs application with latest SDK and XCode 4.2. I need to
I'm developing an iOS application using Core Data. I want to have the persistent
I'm developing an application for iOS where I need to load many views. My
I'm developing an iOS application which (like any other) requires a certain amount of
So I'm developing my first iOS application and I need help.. Simple program for

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.