views:

52

answers:

1

I'm missing something. I'm trying to bring in a new view after pressing a button on the first one. Apparently the following code only works in certain situations:

SecondViewController *controller = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; [[self navigationController] pushViewController:controller animated:YES];

I use this code in another app and it works just fine. So it's something in the way things are set up I guess. The other app was nav-based but this one is just two views. I probably need to specify something somewhere or make some link in IB or something. (I have already verified the button fires the above code so that link is fine.)

Anyone have any ideas what I could be overlooking? I think the navigationController is not the way to go since I'm not using a nav bar setup. So what should I be doing instead to get the second view to come in. I'm sure it's painfully obvious to a lot of you.

A: 

Have you checked that the button and view are correctly wired in Interface Builder? Thats the most likely cause of the inconsistency your seeing.

ennuikiller
Thanks. Yeah, the button is wired correctly and in the debugger I can trace the code through the lines I posted. I even put an NSLog in there before tracing in the debugger. It's just that the view doesn't change.
Troy Sartain