Deprecated object in iOS6


It seems:

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

is now deprecated, and we must use - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations instead.

What should we do at this point of the book? we just go on as the book says?



could this do the same work?

  • (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
    NSLog(@"%@", [locations lastObject]);

…it seems it does…


As each of the objects inside the locations array is an instance of CLLocation, you can grab the last item in the array (which is the most recent location) by doing something like:

CLLocation *location = [locations lastObject];
NSLog(@"Longitude %+.6f, Latitude %+.6f", location.coordinate.longitude, location.coordinate.latitude);

I hope this helps,


Thank you guys for posting this. The suggestion by Jorge749 seems to work for me.

Hopefully BNR can do a better job at more prominently displaying such significant errata.