13
的方法我有一个方法hideButton执行:@selector使用具有参数
-(void) hideButton:(UIButton) *button {
[button setHidden:YES];
}
和我得到一个“不能使用一个对象作为参数的方法”的错误。
我想调用这个
[self performSelector:@selector(hideButton:smallestMonster1)
withObject:nil afterDelay:1.0];
如何才能做到这一点时,可以给该按钮作为参数的方法?因为上述尝试不起作用。我需要能够将按钮作为参数,或者至少让该方法知道1秒后隐藏了哪个按钮被调用。
感谢
谢谢。 hideButton方法如何设置将对象作为参数?如果我尝试上述,我得到不能使用对象作为参数错误/ – jarryd 2010-07-25 12:03:33
不清楚是什么问题... hideButton方法定义是好的,它应该用我的答案正确调用...在第一个参数performSelector - 你提供选择器签名,用withObject - 作为参数传递给选择器的对象。 – Vladimir 2010-07-25 12:14:43
无论哪种方式,如果我尝试hideButton(UIButton)按钮,我得到一个错误,如果我尝试hideButton(UIButton)*按钮,我得到一个错误。我尝试使用(ID),但应用程序崩溃与无法识别的选择器发送到实例错误。 – jarryd 2010-07-25 12:25:09