I asume you used the following delegate to get the last position?
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
The delegate above is deprecated in iOS 6. Now the following should be used:
- (void)locationManager:(CLLocationManager *)manager
didUpdateLocations:(NSArray *)locations
In order to get the last position, simply get the last object of the array:
[locations lastObject]
In other words, [locations lastObject]
(new delegate) equals newLocation
(old delegate) .
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…