In my UIView
, i have a UIButton
displayed.
Inside same UIView class i have a method i'd like to be executed when button is pressed.
When everything is done programmatically, without the use of Interface Builder, how can one link the two together?
Use the UIButton addTarget:action:forControlEvents: message to specify a selector for the UIControlEventTouchUpInside event.
[myButton addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With