开发者

connecting events to actions during runtime

开发者 https://www.devze.com 2022-12-19 21:26 出处:网络
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 ins

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消