I have a button in a menu which when touched, pops up a alert message with two buttons: “Cancel” and “Yes“. This is the code I have for the alert:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Exit game"
message:@"Are you sure?"
delegate:nil
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Yes", nil];
[alert show];
Is it possible to add an action to the button “Yes“?
In your code set the UIAlertView delegate:
As you have set delegate to self, write the delegate function in the same class as shown below: