Hello,
I have a map defined as a IBOutlet and it is showed in a viewcontroller. This map is only created once and I really do not need a local variable for it. The viewcontroller lives as long as the app is running, and the same is about the map. I have defined maps like this as static before but have not been using IB in those cases. So, is it possible to define a varaiable as static even if it is defined in IB? Or may I do something like this instead?
and the use map as normal in the viewconteroller?
What is when a memory warning is received? Is the map recreated or is the already available map overwritten? Because I have not defined a retain in my code I suppse it may not lead to a leak?
MACloop
I have a map defined as a IBOutlet and it is showed in a viewcontroller. This map is only created once and I really do not need a local variable for it. The viewcontroller lives as long as the app is running, and the same is about the map. I have defined maps like this as static before but have not been using IB in those cases. So, is it possible to define a varaiable as static even if it is defined in IB? Or may I do something like this instead?
Code:
@IBOutlet MKMapView *map;
and the use map as normal in the viewconteroller?
Code:
//for instance like
map.userLocation.title = @"You are here!";
map.showsUserLocation = YES;
region.span=span;
region.center=someLocation;
[map setRegion:region animated:NO];
[map regionThatFits:region];
//and like...
[map addAnnotation:theAnnotation];
What is when a memory warning is received? Is the map recreated or is the already available map overwritten? Because I have not defined a retain in my code I suppse it may not lead to a leak?
MACloop