views:

20

answers:

1

i know how to create a control during runtime, my controller class has a IBAction method inside it. How do i connect the event associated with a control to the IBAction method. Just like ctrl+drag inside Interface builder except during runtime

+4  A: 

Suppose you want to "connect" a UIControl control to the IBAction -touchUpInside: of the application delegate self:

[control addTarget:self action:@selector(touchUpInside:) forControlEvents:UIControlEventTouchUpInside];
KennyTM
brilliant!!, thank you