here you go man..
declare a ibaction in your .h file like the following:
- (IBAction)setMap:(id)sender;
and then in your .m file create the method for it that has the segmented controller within it. like follows:
- (IBAction)setMap:(id)sender {
switch (((UISegmentedControl *) sender).selectedSegmentIndex) {
case 0:
myMapView.mapType = MKMapTypeStandard ;
break;
case 1:
myMapView.mapType = MKMapTypeSatellite ;
break;
case 2:
myMapView.mapType = MKMapTypeHybrid ;
break;
default:
break;
}
}
don't forget to connect the segmented control in your ib. also the above has three segments so you have to add the third one by yourself since the segmented control from the object library has two by default.