For my iOS application, I have a login screen and a register screen, each with their own UIViewController (LoginController and RegisterController respectively). On the register screen, I have added a back button that performs a segue to the login screen.
When I click the back button, the implementation file seems to change (from RegisterController.m to LoginController.m), but the actual screen does not change. I have added the code NSLog(@"In LoginController");
at the top of my LoginController.m file (after [super viewDidLoad];
), and when I click the back button on the register screen, my log prints "In LoginController" every time I click the back button, but the screen never changes.
I created the segue similarly to other segues in my application that work correctly. I used the storyboard, held control on the button and dragged the segue to the LoginController.
Does anyone know why this is happening?
EDIT: So I have changed my segues to unwind segues, so that I can get back to the original view of the navigation controller. I have an unwind segue from LoginController to TutorialController, but when I try to unwind from RegisterController to LoginController, the view does not change (but the unwind method in LoginController is called).