Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(void)getUserLocation{
- self.geoCoder = [[CLGeocoder alloc] init];
- self.locationMng = [[CLLocationManager alloc]init];
- locationMng.delegate = self;
- [self.geoCoder reverseGeocodeLocation: locationMng.location completionHandler:
- ^(NSArray *placemarks, NSError *error) {
- CLPlacemark *placemark = [placemarks objectAtIndex:0];
- NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "];
- NSLog(@"I am currently at %@",locatedAt);
- [locationLabel setText:locatedAt];
- }];
- }
- @property (retain, nonatomic) CLLocationManager *locationMng;
Add Comment
Please, Sign In to add comment