call action method for a uibutton without using interface builder in cocoa
cocoa-touch, iphone, objective-c
Solution
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];
Problem
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?