Alex
Alex

Reputation: 3072

iOS CLLocationManager - How to call a method when the location is determined

I am using CLLocation manager to get my lat & long, and it seems to work rather well. However, the first reading of accuracy no matter what, is always 10. From here it seems to home-in correctly starting at about 1500m. The reason that this is a problem is because to determine whether the method is called, I am checking if the accuracy is below 15, which this false reading is, and therefore calling the method at the wrong time. How do I get around this?

Upvotes: 0

Views: 259

Answers (2)

Vladimir
Vladimir

Reputation: 170859

CoreLocation may cache some old location values to "speed up" first location update. You can see if your location is a new one by checking CLLocation's timeStamp property.

Upvotes: 1

Rahul Vyas
Rahul Vyas

Reputation: 28750

you can check using horizontal accuracy there are many posts in stackoverflow regarding cllocationmanager. And for calling a method you can use NSNotificationCenter,Deleagate & protocol mechanism and IBAction of course. It depends on your requirement.

Upvotes: 0

Related Questions