我试图弄清楚我需要使用的代码行,以确定'破坏性'按钮是否在UIActionSheet中按下。如何检查'破坏性'按钮是否被按下(UIActionSheet-iPhone)?
我周围一看,发现委托方法...
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
..而我也设法找到[myActionSheet destructiveButtonIndex]
,我只是不知道如何把这两者结合起来。这是我一直没有成功到目前为止已经试过:
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == destructiveButtonIndex)
{
// Do something...
}
}
谢谢 - 这就是我一直在寻找的东西。我知道我很接近;) –
非常感谢!不知道这个getters。非常棒 – aumanets