I’ve created an app that contains 4 viewcontroller and its .h,.m files…In my firstviewcontroller a button is pressed it goes to secondviewcontroller and in second viewcontroller has two buttons and its used to switch back to firstviewcontroller and another button will goes to thirdviewcontroller.here is my code for firstviewcontroller.m
[[NSBundle mainBundle] loadNibNamed:@"SecondViewController" owner:self options:nil];
and in my secondviewcontroller for first button
[[NSBundle mainBundle] loadNibNamed:@"FirstViewController" owner:self options:nil];
and another button
[[NSBundle mainBundle] loadNibNamed:@"ThirdViewController" owner:self options:nil];
when i select button in firstviewcontroller it loads secondviewcontroller but in second view controller if i select any button i get Sigabart warning…
Can anyone have idea about this…I’ve tried so many ways..
You can use following approaches to perform these tasks :
Approach 1:
In FirstViewController.m write this code at button click :
This will add the secondviewcontroller to current view
In SecondViewController.m to add third View you can write
and to remove the second view you can write this:
Approach 2:
Use Navigation Controller.