Hello everyone!
I have created an alert view with two buttons using the following code:
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle: title
message: msg delegate:nil cancelButtonTitle:@"Replay" otherButtonTitles:@"Highscore", nil];
[alertView show];
I want to run some code when one of the buttons is clicked. In order to do so, I have added the following method to the delegate.m file:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex==0) //Run some code
else //Other code
}
But this method is not called when I press either of the buttons! Can someone tell me why?
Thanks in advance,
Sagiftw