Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. - (IBAction) showAddress // THIS IS A BUTTON WHICH LOCATES COORDINATES
  2. {
  3.  
  4. [addressField resignFirstResponder];
  5. MKCoordinateRegion region;
  6. MKCoordinateSpan span;
  7. span.latitudeDelta=0.2;
  8. span.longitudeDelta=0.2;
  9.  
  10. CLLocationCoordinate2D location = [self addressLocation];
  11. region.span=span;
  12. region.center=location;
  13.  
  14. [mapView setRegion:region animated:TRUE];
  15. [mapView regionThatFits:region];
  16.  
  17. if (location.longitude = (double) -73.2125)
  18. {
  19. addAnnotation = [[AddressAnnotation alloc]initWithCoordinate:location];
  20. [self.mapView removeAnnotation:addAnnotation];
  21. }
  22.  
  23. else
  24. {
  25. addAnnotation = [[AddressAnnotation alloc]initWithCoordinate:location];
  26.  
  27. [self.mapView addAnnotation:addAnnotation];
  28. [addAnnotation release];
  29. }
  30. }
  31.  
  32. if (location.longitude = (double) -73.2125)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement