0

I was reading your comment below:

"I don't know what you mean by "power save" mode, but if you're thinking of when the screen is locked/off, that does not stop Core Location from running if your app is still running. On the contrary it's easy to run down your phone's battery much more quickly than you'd expect if you lock the phone while an app that uses Core Location is running, because the phone will continue to update the app as new location data is available. You could avoid this in your application by listening for UIApplicationWillResignActiveNotification to detect the screen locking, and UIApplicationDidBecomeActiveNotification to detect unlock."

I have an app that uses core location, and as long as my phone is not locked, I get regular NSlog entries from core location. The moment I lock it though, the NSlogs from core location stop until I wake the phone. My code that does the logging is:

-(void) locationManager:(CLLocationManager *)manager 
 didUpdateToLocation:(CLLocation *)newLocation 
     fromLocation:(CLLocation *)oldLocation {

 if (startingPoint == nil) 
  self.startingPoint = newLocation;

 userLocation.latitude = newLocation.coordinate.latitude;
 userLocation.longitude = newLocation.coordinate.longitude;

 NSLog(@"Update from LM: Latitude = %f",newLocation.coordinate.latitude);
 NSLog(@"                Longitude = %f",newLocation.coordinate.longitude);

}

Am I missing something?

Matthias Bauch
  • 89,811
  • 20
  • 225
  • 247
mark
  • 1
  • You might want to edit your question, because currently it reads like you're trying to have, or respond to, a discussion with someone. At the very least try and make it clear what problem you're having, what you've tried in order to solve it and what you'd like us to help with. – David Thomas Feb 24 '10 at 03:30

1 Answers1

0

That looks like part of a response that I wrote to a question over a year ago. See my comment there about it.

For future reference, if you're going to write a response to an answer, you shouldn't create a new question. Stack Overflow has a comment feature that's designed for this purpose. Saying "your comment" with no context at all is asking for confusion (I just happened to read Stack Overflow today, or I wouldn't have noticed).

Community
  • 1
  • 1
Tom Harrington
  • 69,312
  • 10
  • 146
  • 170