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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:42:29+00:00 2026-06-03T06:42:29+00:00

I am developing an iOS Application which uses CLLocationManager to get GPS Data. What’s

  • 0

I am developing an iOS Application which uses CLLocationManager to get GPS Data.

What’s a proper way to stop CLLocationManager when the user presses the home button and then kills the app using fast app switcher?

How can I stop the CLLocationManager then to stop polling for GPS data? Does anybody knows a good way to achieve this, cause normally I can’t execute any code when the user kills the application…

EDIT:
When I am sending the application to background, it should still get significantLocationChanges, so I can’t stop CLLocationManager when the application is sent to the background!

  • 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-03T06:42:30+00:00Added an answer on June 3, 2026 at 6:42 am

    In the AppDelegate there is a method called applicationWillResignActive. This method runs when your app is about to be sent to the background. If you have access to the CLLocationManager from your AppDelegate you can stop it right there. Otherwise you can post a Notification from applicationWillResignActive and whatever class has your CLLocationManager can subscribe to that Notification and handle it from there.

    Post a Notification like this:

    [[NSNotificationCenter defaultCenter] postNotificationName:@"appWillResignActive" object:nil];
    

    And subscribe like this:

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleResign:) name:@"appWillResignActive" object:nil];
    

    Then some method like this:

    - (void)handleResign: (NSNotification *)notification
    {
        // stop CLLocationManager
    }
    

    EDIT:
    If you want to run code when the app is being killed then you can run that code in this method in the AppDelegate:

    - (void)applicationWillTerminate:(UIApplication *)application
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application for ios which uses sqlite3 I need to debug a
I'm developing an iOS application which deals with constantly changing data which is read
I am developing an IOS application, which uses web services (SOAP/WSDL). I have built
I have developing an iPhone application using xcode 4 which is compatible with iOS
i am developing an iOS application with uses UIWebView and Javascript . i have
I am developing iPhone application which involves the frameworks available from iOS 3.2 (Core
I am developing an iOS Application which loads its content from an XML-file over
I am developing an iOS application which resembles a musical instrument. I am trying
I'm developing an iOS application which (like any other) requires a certain amount of
I am developing a rails application which should send push notifications to iOS devices.

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.