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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -