私はUIActionSheetで '破壊的な'ボタンが押されているかどうかを判断するために必要なコード行を整えようとしています。「破壊的」ボタンが押された(UIActionSheet - iPhone)かどうかを確認するにはどうすればいいですか?
私は周りを見ていたし、デリゲートメソッドを見つけた...
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
を...と私も[myActionSheet destructiveButtonIndex]
を見つけることができた、私はちょうど2つを一緒に入れてするかどうかはわかりません。
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == destructiveButtonIndex)
{
// Do something...
}
}
ありがとうございます - それは私が探していたものです。私は近いと分かっていた;) –
多くの感謝!このゲッターについて知りませんでした。本当に素晴らしい – aumanets