Skip to content

Commit

Permalink
didUpdateToLocation was deprecated in iOS 6.0
Browse files Browse the repository at this point in the history
locationManager:didUpdateToLocation:fromLocation: was deprecated in iOS 6.0. It is recommended that locationManager:didUpdateLocations: be used instead.
  • Loading branch information
alexhaas committed Feb 16, 2014
1 parent dda64a8 commit 0a48e2e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Detailed Example App/Forecastr Detailed/FCLocationManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ - (NSString *)localizedCoordinateStringForLocation:(CLLocation *)location
# pragma mark - Location Services Delegate

// Find and store a location measurement that meets the desired horizontal accuracy
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
CLLocation *newLocation = [locations lastObject];

// Test the age of the location measurement to determine if the measurement is cached (in which case, we don't want it)
NSTimeInterval locationAge = -[newLocation.timestamp timeIntervalSinceNow];
if (locationAge > 5.0) return;
Expand Down

0 comments on commit 0a48e2e

Please sign in to comment.