I have a MKMapView
and some markers on the map. When user taps a marker an MKAnnotationView
comes up with a title
and a button
of type UIButtonTypeDetailDisclosure
.
When the user taps the button it should go to another viewController
. The problem is that when the new viewController
comes up , it is blank and it doesn't have the format that I have gave it in the storyboard.
Here is the code for calloutAccessoryControlTapped
:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
MnhmeioViewController * destViewController = [[MnhmeioViewController alloc] init];
Annotation *which=view.annotation;
NSString *whichString=which.title;
Group *tmpGroup;
for(int i=0; i<allGroups.count; i++) {
Group *checkGroup=[allGroups objectAtIndex:i];
if ([checkGroup.title isEqualToString:whichString]) {
tmpGroup=checkGroup;
break;
}
}
NSString *mnhmeioName=tmpGroup.title;
destViewController.titleNavBar = mnhmeioName;
destViewController.selectedArthro = tmpGroup;
[self.navigationController pushViewController:destViewController animated:YES];
}