ios - annotation disclosure button segue to UITableViewController -
i got map 3 annotation pins disclosure buttons on it, want set segue on disclosure button such when click button, brings me uitableviewcontroller
called "tableviewcontroller
"
here codes: mapview.m
- (mkannotationview *)mapview:(mkmapview *)mapview viewforannotation:(id <mkannotation>)annotation { mkpinannotationview *pinview = (mkpinannotationview *)[mapview dequeuereusableannotationviewwithidentifier:@"pinview"]; if (!pinview) { pinview = [[mkpinannotationview alloc] initwithannotation:annotation reuseidentifier:@"pinview"]; pinview.pincolor = mkpinannotationcolorred; pinview.animatesdrop = yes; pinview.canshowcallout = yes; uibutton *rightbutton = [uibutton buttonwithtype:uibuttontypedetaildisclosure]; pinview.rightcalloutaccessoryview = rightbutton; } else { pinview.annotation = annotation; } return pinview; } - (void)mapview:(mkmapview *)mapview annotationview:(mkannotationview *)view calloutaccessorycontroltapped:(uicontrol *)control { // write here? }
connect mapcontroller tableviewcontroller segue named identifier (e.g. abc) , call
[self performseguewithidentifier:@"abc" sender:self];
in calloutaccessorycontroltapped method
Comments
Post a Comment