MKReverseGeocoder delegate location?
- by fuzzygoat
I have a quick question regarding memory management that I am not quite sure about. I currently have a locationManager delegate that calls locationManager:didUpdateToLocation:fromLocation when it resolves the device location. My question is I am looking at adding ReverseGeoCoding after I have obtained the [newLocation coordinate] but am unsure about doing the alloc here, as each time locationManager:didUpdateToLocation:fromLocation gets called I will be alloc-ing a new MKReverseGeoCoder?
// LOCATION
-(void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation {
// GeoCoding:
MKReverseGeocoder *geoCoder = [[MKReverseGeocoder alloc] initWithCoordinate:[newLocation coordinate]];
[geoCoder setDelegate:self];
[geoCoder start];
[self foundLocation];
}
Can anyone point me in the right direction with regards to this? I did try doing the alloc in application:didFinishLaunchingWithOptions: but then realised I did not have access to [newLocation coordinate].
many thanks
gary