1

I have to programmatically define (without using any IBAction) a UIButton that when tapped gets the values of 3 NSString parameters and executes a Segue. The method used for executing the Segue is called via:

[myButton addTarget:self action:@selector(myButtonTapped:) forControlEvents:UIControlEventTouchUpInside];

And then executed as:

-(void)myButtonTapped {
[self performSegueWithIdentifier:@"showNewFromOld" sender:self];}

I understand that the best solution would be to subclass the UIButton (myButton in my case) in order to pass via the sender the 3 NSString as found in this answer: Passing parameters to addTarget:action:forControlEvents Unfortunately I cannot comment this given my newbie level and I would really appreciate some help from the community on this.

Community
  • 1
  • 1
Stefano
  • 33
  • 1
  • 7

1 Answers1

0

The solution I found simply involves the definition of a class method visible to other classes:

+(void)myMethod:...
Stefano
  • 33
  • 1
  • 7