objective c - Switch views from alert view options in xcode -


i want move other views created in storyboard through alert view menu buttons displayed in home page. alert view gives list of buttons containing different views.
how can move views.
i using

-(void) alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex { if (buttonindex == 1){  } if (buttonindex ==2) {  } if(buttonindex == 3){   }  } 

first need instance of storyboard.
instantiate viewcontrollers using storyboard.
push onto navigation stack usual.

-(void) alertview:(uialertview *)alertview clickedbuttonatindex:(nsinteger)buttonindex {     uistoryboard *storyboard = [uistoryboard storyboardwithname:@"storyboard_name" bundle:nil];      if (buttonindex == 1)     {         viewcontroller1 *vc1 = (viewcontroller1 *)[storyboard instantiateviewcontrollerwithidentifier:@"view1"];         [self.navigationcontroller pushviewcontroller:vc1];     }     if (buttonindex ==2)     {         viewcontroller2 *vc2 = (viewcontroller1 *)[storyboard instantiateviewcontrollerwithidentifier:@"view2"];         [self.navigationcontroller pushviewcontroller:vc2];     }     if(buttonindex == 3)     {     } } 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -