-(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
self.geocoder = geocoder;
[geocoder release];
[geocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) {
NSLog(@"error %@ placemarks count %d",error.localizedDescription,[placemarks count]);
for(CLPlacemark *placemark in placemarks)
{
NSLog(@"address dic %@",placemark.addressDictionary);
NSString *localCity = [placemark.addressDictionary objectForKey:@"City"];
[[_mainVC classificationVC] setIsFirstFreshCityData:YES];
[TopInterface setCLLocationCity:[NSString stringWithString:[localCity substringToIndex:[localCity length]-1]]];
NSLog(@"定位城市:%@",localCity);
[TopInterface showToast:@"定位成功,请刷新城市团列表更新商品"];
}
}];
[self.locationManager stopUpdatingLocation];
}