Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

lindseyv

macrumors newbie
Original poster
May 24, 2010
2
0
I am new to objective c development and I have searched for the last couple days on how to solve this problem. Essentially, I am trying to create a main menu for my application that contains three buttons that will load different views depending on the button the the user hits. All of the tutorials I have seen only show one button and every time I add the second, my program crashes. Below is the code that I have put together for two buttons

The second view is working correctly and the buttons are being connected the same way. The problem starts when I try adding the third view. I have even tried adding two view controllers to direct them.

In the main.h

Code:
@interface ViewViewController : UIViewController {


IBOutlet SecondViewController *secondViewController;
IBOutlet FourthViewController *fourthViewController;
}

- (IBAction)gotoSecondView;
- (IBAction)gotoFourthView;


In the main .m
Code:
- (IBAction)gotoSecondView{
[self presentModalViewController:secondViewController animated:YES];
}

- (IBAction)gotoFourthView{
[self presentModalViewController:fourthViewController animated:YES];
}

Thank you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.