Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. CLGeocoder *geocoder = [[CLGeocoder alloc] init];
  2.  
  3. CLLocation *loc = [[CLLocation alloc] initWithLatitude:
  4. 37.712900 longitude:-122.452020];
  5.  
  6. [geocoder reverseGeocodeLocation:loc
  7. completionHandler:^(NSArray *placemarks, NSError *error)
  8. {
  9. [self.indicator hide:YES];
  10. if(placemarks != nil)
  11. {
  12. if (placemarks.count == 1)
  13. {
  14. CLPlacemark *place = [placemarks objectAtIndex:0];
  15. NSString *road = [place.addressDictionary objectForKey:@"Thoroughfare"];
  16. NSLog(@"%@", road);
  17. // Get road geo points
  18. }
  19. }
  20. else
  21. {
  22. [Utilities alertDisplay:APP_NAME message:@"Unable to locate the location"];
  23. }
  24. }];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement