The most recent location will be at the end of the locations
array.
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
CLLocation *mostRecentLocation = [locations lastObject];
bool haveValidAltitude = (mostRecentLocation.verticalAccuracy > 0);
if(haveValidAltitude)
{
NSLog(@"current altitude is: %g meters above sea level", mostRecentLocation.altitude);
}else{
NSLog(@"current altitude is unavailable");
}
}