Reputation: 428
I want to click the back button in the navigationBar programmatically in my second view. It's call it this way:
Archiv *archiv = [[Archiv alloc] initWithNibName:@"Archiv" bundle:nil];
archiv.title = [NSString stringWithFormat:@"Archiv %@", [sender titleForState:UIControlStateNormal]];
[self.navigationController pushViewController:archiv animated:YES];
And now i'm in the Archiv.m and after a specific event i want to get back to the first controller (without clicking the back button) - instead i want to perform the click programmatically.
Is it possible for this case?
Helpful would be to know which method is called if i click on this button, so don't even have to perform the click.
Upvotes: 4
Views: 4077
Reputation: 8267
yes you can
this will take you to your first view controller
[self.navigationController popToRootViewControllerAnimated:YES];
Upvotes: 16