iphone - Annotation Detail View not Loading in Mapkit -


i have map shows various pins based on users location. can view pins , there callouts without problem. when press detail disclosure button, mapdetailinfo not load. here of code.

- (mkannotationview *) mapview:(mkmapview *)mapview viewforannotation:(id <mkannotation>) annotation { // specify mkpinannotationview use each annotation.   mkpinannotationview *businesslistingpin = (mkpinannotationview *)[self.mapview dequeuereusableannotationviewwithidentifier: @"blpin" ];  if (businesslistingpin == nil) {     businesslistingpin = [[mkpinannotationview alloc] initwithannotation:annotation reuseidentifier:@"blpin"]; } else {     businesslistingpin.annotation = annotation; }  // if annotation user's location, don't show callout , change pin color if(annotation == self.mapview.userlocation) {     businesslistingpin.canshowcallout = no;     businesslistingpin.pincolor = mkpinannotationcolorred; } else {     businesslistingpin.canshowcallout = yes;     businesslistingpin.pincolor = mkpinannotationcolorpurple;     businesslistingpin.rightcalloutaccessoryview = [uibutton buttonwithtype:uibuttontypedetaildisclosure];  }  return businesslistingpin; }  - (void)mapview:(mkmapview *)mapview   annotationview:(mkannotationview *)view  calloutaccessorycontroltapped:(uicontrol *)control { mapdetailinfo *abc = [[mapdetailinfo alloc]init]; uinavigationcontroller *nav = [[uinavigationcontroller alloc] init]; [nav pushviewcontroller:abc animated:yes]; } 

not sure if matters or not, part of tab bar application. appreciated. thanks!

you instantiating uinavigationcontroller (uinavigationcontroller *nav = [[uinavigationcontroller alloc] init];) , pushing new vc onto that, never add nav controller current view stack. calling init doesn't add navigation controller stack.

when create uitabcontroller, can create + use navigation controller each tab. push new vc onto that navigation controller.

hope helps.

** edit

if you've got navigation controllers of tabs, change code this:

- (void)mapview:(mkmapview *)mapview annotationview:(mkannotationview *)view  calloutaccessorycontroltapped:(uicontrol *)control {     mapdetailinfo *abc = [[mapdetailinfo alloc]init];     [self.navigationcontroller pushviewcontroller:abc animated:yes]; } 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -