Hi have an newbie issue with objective-c, cocoa & iPhone. I've declared mapView in my application delegates applicationDidFinishLaunching:application:
which is instance/pointer of MKMapView
class. mapView
is a member of my application delegate.
In my view controller in viewDidLoad: I get instance of my application delegate with the following:
appDelegate = [[UIApplication sharedApplication] delegate];
My view controller also has got MKMapView *mapView as a member. In viewDidLoad: I try to set it this way:
mapView = [appDelegate mapView];
but it seems that I'm not able to get pointer or "reference" to the actual mapView because when I try to [mapView setRegion:region animated:YES];
it does not work. How ever [[appDelegate mapView] setRegion:region animated:YES];
does work.
So the question is how do I get a pointer to appDelegates
mapView
from my view controller?