0

I'm starting to work on an ipad application that would require activity (or functions) on the detail view and would push (or transfer) to another view controller depending on the button tapped.

Trying to figure out if segue is what I'm supposed to be using with this.

My storyboard looks like this:

SplitViewController -> navigationcontroller(master view) / login (detail view) -> dashboard (will be transferred on successful login

But whenver I tap the button and successfully login it would give me this error:

Push segues can only be used when the source controller is managed by an instance of UINavigationController.'

Thoughts?

EDIT: Code that pushes to the next viewcontroller

- (IBAction)btnSubmit:(id)sender {
    User *user = [[User alloc] init];
    user.email = self.txtEmail.text;
    user.rawPassword = self.txtPassword.text;

    if(user.isValid){
        [self performSegueWithIdentifier:@"LoginSuccess" sender:self];
    }
}
gdubs
  • 2,724
  • 9
  • 55
  • 102

1 Answers1

2

The error is telling you that you are using the option push without embedding a navigation controller. If you don't want to use navigation controller just click on the segue connection in storyboard and change it to modal and it will move the views without error.

Adrian P
  • 6,479
  • 4
  • 38
  • 55
  • well that was easy. thanks! any chance you know if i can use a login view controller that will push to the splitview instead of the splitview loading a login page on the detailview? been looking through google and nothing comes up that makes sense, most recommends plug ins and the rest would be modals to be called. if not, thanks anyway! waiting for the time to accept this as answer. – gdubs Feb 06 '13 at 04:49
  • Yes for that your login view has to be the first view loaded by your app delegate. Then you can push the split view from there. Look for creating a login view in iOS. Most of them are the tuts using xib file but you can incorporate it with storyboard. Post another question and i will look up some of the codes I have on my Mac and see what I can come up with. In the meanwhile you can mark my answer as the correct one please. – Adrian P Feb 06 '13 at 04:56
  • Here you go sir http://stackoverflow.com/questions/14722152/splitviewcontroller-with-a-login-view-controller-as-the-root and yes i already accepted it, SO wouldn't let me accept it if it's only less than 15 min or something like that since I posted the question. – gdubs Feb 06 '13 at 05:23