tags:

views:

91

answers:

2

I am trying to implement signup/login via a nav controller for my iphone app.

My issue is I need to detect the GO button and pop to the nav root. Here is my code:

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    NSLog(@"RETURN KEY HIT!");
    [textField resignFirstResponder];
    NSLog(@"email = %@", emailTextField.text);
    NSLog(@"pw = %@", passwordTextField.text);
    [navController popToRootViewControllerAnimated:TRUE];
    return YES;
}

GO does cause this method to be called, but the nav controller doesn't pop. I'm not surprised as the method returns a BOOL so it's obviously not designed for this use.

So what is the correct way to handle detecting a GO and acting on it?

Thanks!

alt text

A: 

Did you try [self.navigationController popToRootViewControllerAnimated:TRUE];

olipion
A: 

simple. as Yannick L suggested I had a null for my nav. Duh :)

phil swenson