connecting events to actions during runtime
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 runt开发者_开发技巧ime
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];
精彩评论