ios - Need UISegmentControl with UINavigationController To Push ViewControllers -
i have 3 uiviewcontrollers , 1 separate viewcontroller uisegmentcontrol have push 3 viewcontrollers using navigationcontrollers. want these views appear below uisegmentcontrol when segmentcontrol selected. tried push , pop logic, couldn't result right. below code 1 controller-
-(ibaction)valuechanged:(id)sender{ segmentcontrol=(uisegmentedcontrol*)sender; if (segmentcontrol.selectedsegmentindex==1) { firstview = [self.storyboard instantiateviewcontrollerwithidentifier:@"firsttopviewcontroller"]; [self.navigationcontroller pushviewcontroller:firstview animated:yes]; [self.navigationcontroller popviewcontrolleranimated:no]; self.navigationcontroller.navigationitem.titleview=segmentcontrol; nslog(@"1"); } }
can tell me i'm doing wrong here?
Comments
Post a Comment