在我的应用程序UIButtons
中,我有多个要添加目标。
事实证明,最近添加的目标首先执行,然后是其余目标。
例如,使用以下代码:
[button addTarget:self action:@selector(someAction:) forControlEvents:UIControlEventTouchUpInside];
[button addTarget:self action:@selector(someOtherAction:) forControlEvents:UIControlEventTouchUpInside];
如果我会在里面补上button
,someOtherAction:
会被叫过someAction
。
那不是我想要的。我想对目标进行排序,以便我可以在该按钮内部进行修饰,首先称为someAction:
能力,然后是其他操作someOtherAction:
我不确定从哪里开始,我应该继承并覆盖其中的某些东西UIButton
还是深入挖掘UIControl
?
谢谢您的帮助!
-大卫