سؤال

I'm using CoreLocation,and I want to call a method to do some computations on the latitude and longitude after they have been assigned valid values or after these values have been updated.

How do you implement this? I was considering using performSelector, but those methods take a time delay -- i don't want a time delay, i want to know that latitude and longitude have valid values first.

هل كانت مفيدة؟

المحلول

Why not call whatever method you want in Core Locations delegate method:

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

Rule of thumb is to ignore the first set of CLLocation coordinates.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top