The UpdatedLocation in CLLocationManagerDelegate is now obsolete.
How would I get this functionality and under what new function call?
OLD:
public override void UpdatedLocation (CLLocationManager manager, CLLocation newLocation, CLLocation oldLocation)
{
manager.StopUpdatingLocation ();
locationManager = null;
callback (newLocation);
}
Starting with iOS 6, you have to override the LocationsUpdated method in your delegate:
public override void LocationsUpdated (CLLocationManager manager, CLLocation[] locations)
{
// Code
}
The locations parameter will always contain at least one CLLocation object and the most recent location will be the last item in the array:
CLLocation recentLocation = locations[locations.Length - 1];
If your app supports iOS 5, you can keep the UpdatedLocation method. No other changes are needed, the same things apply when you call StartUpdatingLocation and StopUpdatingLocation.
This is explained in Apple's documentation on CLLocationManager's startUpdatingLocation method here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With