I am trying to perform the smile task of having two alerts in a single View Controller. The code below works fine, but how would I make another instance of it elsewhere in t
Simply set a tag to each Alert view and check which one sent the messeg.
alertView.tag=0;
And then
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if(alertView.tag==0){
if(buttonIndex == 0)//OK button pressed
{
//do something
}
else if(buttonIndex == 1)//Annul button pressed.
{
//do something
}
}else{
if(buttonIndex == 0)//OK button pressed
{
//do something
}
else if(buttonIndex == 1)//Annul button pressed.
{
//do something
}
}