Friday, 13 September 2013

Transition to a Navigation View Controller

Transition to a Navigation View Controller

I have the following code:
- (IBAction)buttonPressed:(UIButton *)sender
{
//sentder.titleLabel
NSString *label = [(UIButton *)sender currentTitle];
if ([label isEqualToString:@"Register"])
{
[sender setTitle:@"Registers" forState:UIControlStateNormal];
RegisterViewController *viewCon = [[RegisterViewController alloc]
init];
RegisterNavigationController *navigation =
[[RegisterNavigationController alloc] init];
[navigation pushViewController:viewCon animated:YES];
//self performSegueWithIdentifier:@"MySequeIdentifier" sender:];
}
....
I have a startController with the following button code that gets called
correctly. I created a brand new default registerViewController
(UIViewController) and a registerNavigationContoller
(UINavigationController class). How do I get my button click to animate to
the registerViewController and have that view controller have a bar with a
back button?
Am I doing this wrong, is the startViewController supposed to be a
UINavigationController as it's just a UIViewController? If so how do I get
rid of the top bar on this page?

No comments:

Post a Comment