Search code examples
objective-cxcodestoryboardpushviewcontroller

StoryBoard Navigation


I have one problem, I have my first view controller and when i push a button to connect with my host to check if the user is registered.. but when i push the button the storyboard pass the next view and after check the user...

So i'm trying pushViewController with code, but i dont know how push a view that is inside the storyboard.

Here is the code : http://pastie.org/3025806

enter image description here


Solution

  • You have to connect the first view with the second view and choose push. It's important to connect the first view and the second view, NOT the Button and the second view.


    Edit: I've read your question again. If you change that it will work. If you connect the button and the view controller the push action will be executed directly.

    The following is just a tip ;o)


    Click on segue, which links to the second view. You have to give a name to that segue so change the identifier name to something like "loginDone". (Open the right menu for that ;o))

    Now you can do this after you checked your login form:

    [self performSegueWithIdentifier:@"loginDone" sender:self];