`в виду сделал загрузку
locationManager=[[CLLocationManager alloc] init];
locationManager.delegate=self;
appDelegate.IsFromRefreshPosition=YES;
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
if ([CLLocationManager locationServicesEnabled])
{
[locationManager startUpdatingLocation];
}
geocoarder returns the plackmark of current location
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
currentLocation = newLocation;
[currentLocation retain];
[locationManager stopUpdatingLocation];
NSLog(@"%f %f",currentLocation.coordinate.latitude,currentLocation.coordinate.longitude);
geocoder = [[MKReverseGeocoder alloc] initWithCoordinate:currentLocation.coordinate];
[geocoder setDelegate:self];
[geocoder start];
}
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
NSLog(@"locationManager:%@ didFailWithError:%@", manager, error);
}
-(void)reverseGeocoder:(MKReverseGeocoder *)geocoder1 didFindPlacemark:(MKPlacemark *)placemark
{
NSLog(@"The geocoder has returned: %@",[placemark addressDictionary]);
NSLog(@"CountryName :",[[placemark addressDictionary] objectForKey:@"Country"]);
NSLog(@"cityName :",[[placemark addressDictionary] objectForKey:@"City"]);
NSLog(@"After SubLocality %@",Addressstr);
}
}
-(void)reverseGeocoder:(MKReverseGeocoder *)geocoder1 didFailWithError:(NSError *)error
{
NSLog(@"reverseGeocoder:%@ didFailWithError:%@", geocoder, error);
}
ЕГО РАБОТАЕТ В УСТРОЙСТВЕ, КАК МНЕ СВОЙ