Сначала напишите свой UIAlertView, как показано ниже,
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Warning" message:@"You will jump to a when you click 'Yes,Go',or click 'No,I am not' for exit"
delegate:self
cancelButtonTitle:@"Yes,Go"
otherButtonTitles:@"No,I am not"
,nil];
[alert show];
[alert release];
, тогда вы можете определить, какая кнопка нажата пользователем, как показано ниже:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex ==0)
{
//handle it for "Yes,Go"
}
else if (buttonIndex ==1)
{
//handle it for "No,I am not"
}
}