-1
Ich habe den folgenden Code, um Anrufe aus der App zu tätigen. Wenn ich jedoch auf den Knopf klicke, passiert nichts. Irgendwelche Gedanken, was ich falsch machen könnte?Taste zum Telefonieren in iOS Xcode
- (void)phonePressed:(id)sender
{
UIButton *btn = (UIButton*)sender;
NSString *key = [self.dictArray.allKeys objectAtIndex:btn.tag];
NSMutableArray *arrData = [self.dictArray objectForKey:key];
NSMutableDictionary *dict = [arrData objectAtIndex:btn.tag];
UIApplication *application = [UIApplication sharedApplication];
NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",[dict objectForKey:@"contact_phone"]]];
[application openURL:URL options:@{} completionHandler:^(BOOL success) {
if (success) {
NSLog(@"Opened url");
}
}];
}
Niemand weiß, was dictArray ist. –
Duplizieren: https://stackoverflow.com/questions/27259824/calling-a-phone-number-in-swift –
können Sie uns Ihr dictArray ?? – luckyShubhra