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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:59:13+00:00 2026-05-24T23:59:13+00:00

In my app I have a button, when the user clicks it, it brings

  • 0

In my app I have a button, when the user clicks it, it brings up a modal view controller which gets the user’s location (with a UIActivityIndicator and image on). When it has there location it will send them off to another application.

This works well on older devices (without multi-tasking) because the app simply re-launches back to it’s previous state after I go back to it.

However on devices that have multi-tasking, when I resume the app, the view that tells the user it’s getting their location is still there – which is not at all desired.

My first idea was to set a BOOL when it was about to fire them off to the other app, and then in the viewDidAppear, if the BOOL is true, dismiss the modal view.

That would work, if viewDidAppear got called when an app resumes active. As I have just learnt, it doesn’t.

Is there a method that view controllers can respond to when the app resumes active to that view? Or, will I have to set up delegation etc with the app delegate? If so, can you explain how I would do that?

  • 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-24T23:59:14+00:00Added an answer on May 24, 2026 at 11:59 pm

    You can send a notification when the app becomes active and listen to it into your modalviewcontroller. I think this is the easiest way.

    // Into the app delegate
    - (void)applicationDidBecomeActive:(UIApplication *)application
    {
        [[NSNotificationCenter defaultCenter] postNotificationName:@"ApplicationDidBecomeActive" object:nil];
    }
    
    // Into your modal view controller register it for the given notification
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:@"ApplicationDidBecomeActive" object:nil];
    
    - (void)applicationDidBecomeActive:(NSNotification *)notification
    {
    //...
    }
    

    Otherwise you can disable the background mode of your application by setting the “UIApplicationExitsOnSuspend” key to YES in the info.plist file.

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

Sidebar

Related Questions

I have an app in which the user clicks a button, triggering an iFrame
I have an view in my App which has a number of buttons based
I have an AJAX app. A user clicks a button, and the page's display
in my app i have a button named Search, When the user clicks the
in my app i have a list view. Each list consists of a image,
in my app i have placed a button called Add Photo, when the user
I am developing a app in which i have rotate a delete button when
I have got some inapp billing in my Android app. When the user clicks
in my app i have 4 buttons and when the user clicks any of
In my Android app, when a user clicks a button, I want it to

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.