Hey guys sorry I was looking around but none of the expected expression error forums on here pertained to mine. I am making my first app and nothing I have learned can help me with this error. I've looked and looked only finding the error in complex apps while mine is pretty basic. Here it is: THIS IS THE UPDATED CODE!!!!!
- (IBAction)StartButton:(id)sender; <--- "Expected Expression"
{
PrimaryViewController *controller = [[PrimaryViewController alloc]
initWithNibName:@"PrimaryViewController" bundle:nil];
[self.navigationController pushViewController: controller animated:YES];
}
READ THIS- This is the updated code and the error says on the first line of this "Expected Expression" Thanks! ((((Update:: It is with xibs and the StartViewController is its own class.))))Please please help! On the - (IBAction)... line it says expected expression. I'm trying to push the view controller from the main menu to the start screen when you press the start button IBAction. It is linked to the files menu as well. Thanks!
You need to create an instance of StartViewController
and push that. Trying to push the class itself doesn't make sense.
Something like:
StartViewController *controller = [[StartViewController alloc] initWithNibName:@"StartViewController" bundle:nil];
[self.navigationController pushViewController: controller animated:YES];
(Assuming that's the right name for the .xib file and that you don't already have an instance of StartViewController
on your navigation stack.)