Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Different location manager delegate methods of iOS 5 and iOS 6

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 324
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: