ios - Navigationcontroller don't work fine -
i have (hopefully) little issue. rightcalloutaccessoryview
button method. seek force navigationcontroller
another viewcontroller
dont work fine. black screen. navigationbar
disabled
- (mkannotationview *)mapview:(mkmapview *)mapview viewforannotation:(id <mkannotation>)annotation { // ... code ... pinannotationview.canshowcallout = yes; uibutton *detailbutton = [uibutton buttonwithtype:uibuttontypedetaildisclosure]; [detailbutton addtarget:self action:@selector(showdetailview:) forcontrolevents:uicontroleventtouchupinside]; pinannotationview.rightcalloutaccessoryview=detailbutton; // ... code ... }
button:
-(ibaction)showdetailview:(uibutton *)sender { infoviewcontroller *infoview = [[infoviewcontroller alloc] init]; [self.navigationcontroller pushviewcontroller:infoview animated:yes]; nslog(@"pushed button!!!!!!"); }
my goal: viewcontroller
press detailbutton
, force infoviewcontroller
.
maybe little mistake, not find.
if infoviewcontroller in storyboard, need one, not create new 1 alloc init. infoviewcontroller needs identifier in storyboard, can instantiate like:
infoviewcontroller *infoview = [self.storyboard instantiateviewcontrollerwithidentifier:@"infoviewcontroller"];
ios uibutton mkmapview mkannotation
No comments:
Post a Comment