Neenu Neenu - 5 months ago 28
Objective-C Question

How to trigger UIButton action programmatically

I have several buttons in one class and their actions are separate.
I created the instance of that class in another class. And I have the UIButton array in the 2nd class. I want to call each buttons action programmatically. Is there any way to do this in iOS.


UIButton has a method to invoke the targets/selectors that are linked to a certain control event:

[button sendActionsForControlEvents:UIControlEventTouchUpInside];