第一个警报中的按钮执行第二个警报,这基本上是确认呼叫某人。我没有收到任何错误,但它不起作用。
当我按下第二个警报时,呼叫按钮崩溃了
-(void) alertView: (UIAlertView *) alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
NSString *buttonString = [alertView buttonTitleAtIndex:buttonIndex];
if ([buttonString isEqualToString:@"Phone"])
{
UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:@"Notice!" message:@"You are about to call .... Do you wish to continue?" delegate:nil cancelButtonTitle:@"Cancel" otherButtonTitles:@"Call", nil];
[alert2 show];
if ([buttonString isEqualToString:@"Call"]){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://12345678"]]];
}
if([buttonString isEqualToString:@"Website"]){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"website"]];
}
if ([buttonString isEqualToString:@"Facebook"]){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com/groups/..../"]];
}
}
}