How can I set up a NSAutoreleasePool within a method where the method have a return type? Is there any way to do that? like the methods like below:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation, AddressAnnotation>) annotation;
Or a within a overridden method like:
- (void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated;
I can see in the main.m file like below:
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
//Do anything here
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}
So it should be like this?