UIAlertView – creating and detecting button tap

Declare the UIAlertView delegate in the yourViewController.h:

 

Create the alertView:

 

Detect which alertView button was tapped: