I am a newbie iOS programmer, here is my question: I have mapview and segmented control, also changeMapType function which get called when UIControlEventValueChanged occures, like this
// change map type with segmented control
- (IBAction)changeMapType:(id)sender
{
NSInteger i = [mapTypeControl selectedSegmentIndex];
if (i == 0){
[worldView setMapType:MKMapTypeStandard];
}
if (i == 1) {
[worldView setMapType:MKMapTypeSatellite];
}
if (i == 2) {
[worldView setMapType:MKMapTypeHybrid];
}
}
and in viewDidLoad I want to call this method to set up which map type is first.
[mapTypeControl setSelectedSegmentIndex:2];
[self changeMapType:nil];
above code works fine, but below code works fine either
[mapTypeControl setSelectedSegmentIndex:2];
[self changeMapType:self];
so finally, what to pass as SENDER? which is correct?