I'm currently calling an action method in an object by dragging a button to the view in interface builder. I then drag an object to the panel and specify my object with the action method. I shift drag my button to the object and choose my action method. This works in calling my method.
I would like to instead call my action method without interface builder from uiview class that the current nib is derived from.
Does anyone know how I can accomplish this?
I read the question differently than Jasarien from the first answer.
If you are trying to get a button to respond to a click, but you want to setup the selected target method without using IB, it would go like this.
[myButton addTarget:self action:@selector(myMethod:) 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