1

My app is permanently polling for coreLocation - even when not running.

1) I set my UIBackgroundModes to location to get location updates in the background (no problem, I believe).

2) I messed with [locationManager startUpdatingLocation] and stopUpdatingLocation

3) The app started forcing the gps location arrow icon to be on all the time - even when I stop the app (by pressing home twice). The only way to shut off the arrow is to remove the app.

4) I've tried reverting my code back a few days, but nothing helps.

What can cause this?

BankStrong
  • 419
  • 9
  • 21

3 Answers3

2

I had a similar issue once upon a time. Take a look and see if that answer helps you out.

EDIT: If if turns out that you can remove the location services icon from the status bar by killing the app the correct way, then you problem is likely not the same one I had and you can safely ignore this =)

Community
  • 1
  • 1
Matt Wilding
  • 20,115
  • 3
  • 67
  • 95
  • That's EXACTLY what happened to me. – BankStrong Mar 15 '11 at 00:44
  • @BankStrong: Awesome. That problem killed me for the longest time. It's why I registered an account here in the first place. Glad it helped. – Matt Wilding Mar 15 '11 at 00:49
  • Any clue what triggers this problem? I'd hate to recommend a full wipe to a customer. – BankStrong Mar 15 '11 at 00:53
  • times like this make me grateful for the kindness of strangers and for StackOverflow. Crazy problem. – BankStrong Mar 15 '11 at 00:54
  • @BankStrong: I have absolutely no idea. In my case, I wasn't the first dev on the project and it manifested before I inherited it. I think it's a bug in the OS, honestly, but it's possible that it won't occur without some abuse of the location manager. I really don't know. – Matt Wilding Mar 15 '11 at 00:56
0

It sounds like from item 1) that you want background location updates.

If you don't want it to get location updates when in the background you need to call stopUpdatingLocation when your app gets put into the background.

Pressing Home twice doesn't stop the app. You also have to hold the app's icon until the red (-) appears and tap that to kill the app.

progrmr
  • 75,956
  • 16
  • 112
  • 147
  • You're right - I want background locations. Until I kill the app (pressing the red - as you describe). Can't figure out why the arrow stays then. – BankStrong Mar 15 '11 at 00:06
0

I think Apple has done a bad job in educating developers and users both about what that arrow means. People think that the blue arrow depicts evil and that an app is constantly monitoring the user's location. All that arrow means is that an app has used your location in last 24 hours.

Check my blog entry here and feel free to comment if you don't agree: http://iostipsntricks.wordpress.com/2011/05/10/my-app-is-sucking-battery-life-out-of-my-iphone-corelocation/

StackThis
  • 1,262
  • 1
  • 14
  • 23