-3

When I use CTRL+Click on next view it don't use the IBAction but goes straight to the next view.

How can I make the app use the IBAction first and then go to the next view.

The IBAction add data to the database, in the next screen I want to add some more data, I know how that works but can't go to the next screen and add the data...

Sorry for the messy description but hope you understand

Jasper
  • 3
  • 3

2 Answers2

1

If I understand your question correctly you want to do something on button-click, then perform a segue.

  1. Make a general segue from your viewcontroller, not from the button.
  2. Connect IBAction like normal.
  3. In your IBAction method - use self.performSegueWithIdentifier("MyIdentifier")
ullstrm
  • 9,812
  • 7
  • 52
  • 83
0

As per my understanding if you can go to next view on button action using below code..

First go to Identity Inspector --> give Storyboard ID to Next View that you want to go..

-(IBAction)buttonAction:(id)sender{
    [self.navigationController pushViewController:[self.storyboard instantiateViewControllerWithIdentifier:@"storyBoardIdentifier"] animated:YES];
}

Hope it helps you..

Vidhyanand
  • 5,369
  • 4
  • 26
  • 59