Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)locationManager:(CLLocationManager *)manager
- didUpdateToLocation:(CLLocation *)newLocation
- fromLocation:(CLLocation *)oldLocation {
- CLLocationCoordinate2D coords = newLocation.coordinate;
- lastLat = coords.latitude;
- lastLng = coords.longitude;
- CLGeocoder *reverse = [[CLGeocoder alloc] init];
- CLLocation *location = [[CLLocation alloc] initWithLatitude:coords.latitude
- longitude:coords.longitude];
- lastAccuracy = newLocation.horizontalAccuracy;
- lblAccuracy.text = [NSString stringWithFormat:@"%f",lastAccuracy];
- if(lastAccuracy <= 10)
- {
- [reverse reverseGeocodeLocation:location
- completionHandler:^(NSArray *placemarks, NSError *error) {
- if ([placemarks count] > 0) {
- CLPlacemark *place = [placemarks objectAtIndex:0];
- strCEP = place.postalCode;
- strLastSubLocation = place.subLocality;
- strLastLocation = place.locality;
- strEndereco = place.thoroughfare;
- lblEndereco.text = strEndereco;
- ];
- }
- }];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement