If you want to go the top of your navigation controller’s stack, which is your root view controller, than you can use the following line of code.
- (IBAction)goHome:(id)sender { 
     [self.navigationController popToRootViewControllerAnimated:YES]; 
 }
1
solved ios how can my app go back to the first screen?