Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIAlertView easy way to tell if cancel button is selected

I know I've done this before but I just can't figure it out again.

What is the method I would use to see if a cancel button was pressed. I don't want to do it based on the button index. There is a way to do it, something like:

[alertView isCancelIndex:index];

Anyone know?

like image 747
CodeGuy Avatar asked Aug 03 '11 15:08

CodeGuy


1 Answers

The UIAlertView has a property of cancel button index

@property(nonatomic) NSInteger cancelButtonIndex

Usage

[alertView cancelButtonIndex]
like image 108
rich Avatar answered Oct 07 '22 00:10

rich