remove “one” action from multi actions in target-action UIbutton

不想你离开。 提交于 2019-12-14 03:01:17

问题


[_btt1 addTarget:self action:@selector(clicked:) forControlEvents:UIControlEventTouchUpInside];
[_btt1 addTarget:self action:@selector(clicked2:) forControlEvents:UIControlEventTouchUpInside];

There are 2 actions in _btt1.

2013-05-31 10:33:31.300 testTargetAndSelector[6029:c07] actions : (
    "clicked:",
    "clicked2:"
)

I remove clicked2 action like this.

[_btt1 removeTarget:self action:@selector(clicked2:) forControlEvents:UIControlEventTouchUpInside];

but there is no action in _btt1.

2013-05-31 10:33:32.731 testTargetAndSelector[6029:c07] actions : (null)

How can I remove single action from multi Actions?

来源:https://stackoverflow.com/questions/16848613/remove-one-action-from-multi-actions-in-target-action-uibutton

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!