Guest User

Untitled

a guest
Jul 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. -(void)startLocationManager
  2. {
  3. CLLocationManager *locationManager = [[CLLocationManager alloc] init];
  4. locationManager.delegate=self;
  5. locationManager.desiredAccuracy=kCLLocationAccuracyBestForNavigation;
  6. [locationManager startUpdatingLocation];
  7. }
  8.  
  9. -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
  10. {
  11. CLLocationCoordinate2D coordinate = [newLocation coordinate];
  12. double dblLatitude = coordinate.latitude;
  13. double dblLongitude = coordinate.longitude;
  14. }
  15.  
  16. if ([CLLocationManager locationServicesEnabled])
  17. {
  18. CLLocationManager *locationManager = [[CLLocationManager alloc] init];
  19. [locationManager startUpdatingLocation];
  20.  
  21. CLLocationCoordinate2D *currentLocation = locationManager.location;
  22.  
  23. [locationManager stopUpdatingLocation];
  24. [locationManager release];
  25. }
  26.  
  27. [mapView setShowsUserLocation:YES];
  28. CLLocationCoordinate2D *currentLocation = mapView.userLocation.coordinate;
Add Comment
Please, Sign In to add comment