What are the button indexes in a three-button UIAlertView

iOS Simulator Screen shot 30 Dec 2013 09.50.43

The cancel button is always index 0, and all other buttons in the array start at index 1 counting up.

For completion, here’s how to create it:

And here’s how to react to it:

This is a delegate method, so the reacting class needs to conform to the UIAlertView Protocol like so:

Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.

Add your voice!