Несколько UIAlertView, каждый со своими кнопками и действиями

Я создаю представление в Xcode 4.3 и не знаю, как указать несколько UIAlert Представления, которые имеют свои собственные кнопки с отдельными действиями. В настоящее время мои оповещения имеют свои кнопки, но те же действия. Ниже мой код.

-(IBAction)altdev {
    UIAlertView *alert = [[UIAlertView alloc] 

                          initWithTitle:@"titleGoesHere"
                          message:@"messageGoesHere"
                          delegate:self
                          cancelButtonTitle:@"Cancel"
                          otherButtonTitles:@"Continue", nil];
[alert show];
}

-(IBAction)donate {
    UIAlertView *alert = [[UIAlertView alloc] 

                          initWithTitle:@"titleGoesHere"
                          message:@"messageGoesHere"
                          delegate:self
                          cancelButtonTitle:@"Cancel"
                          otherButtonTitles:@"Continue", nil];
    [alert show];
}

-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 1) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.examplesite1.com"]];
         }
}


-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == 1) {
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"examplesite2.com"]];
    }
}  

Спасибо за любую помощь!

16
задан DiscoveryOV 4 March 2012 в 08:36
поделиться