0
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ok" 
                                                        message:@"Canc?"
                                                       delegate:self 
                                              cancelButtonTitle:@"OK"
                                              otherButtonTitles:@"Annul", nil];
[alertView show];
[alertView release];
and its delegate method:
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {

if(buttonIndex == 0)//OK button pressed
{
    //do something
}
else if(buttonIndex == 1)//Annul button pressed.
{
    //do something
}

Post a Comment

 
Top