user3724875
user3724875

Reputation: 15

link between prepareForSegue and action button

Can prepareForSegue method be applied in an action button?

If yes please can anyone teach me how?

Upvotes: 0

Views: 84

Answers (1)

Lord Zsolt
Lord Zsolt

Reputation: 6557

You don't call prepareForSegue yourself.

You create an action for your button, then call the performSegue:

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

Then in the prepareForSegue you do what you want based on the identifier.

Upvotes: 3

Related Questions