The delegate method iOS 5 used was as follows
-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
This delegate method used to access two locations namely oldLocation and the newLocation and then updated the users location on the basis of these two locations. But iOS 6 changed the method to
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
The new delegate method makes use of an array containing the locations and updates the user's location on the basis of the locations stored in the array. To get the latest update of the position of the user the programmer can access the last object of the locations array declared by the method.
[locations lastObject];
0 Comment(s)