ios - 在 iOS 中以编程方式调用带有访问代码的电话号码

标签 ios iphone ios4 ios-simulator

如何在 iOS 中以编程方式调用包含号码和访问代码的电话号码?

例如:

number: 900-3440-567
Access Code: 65445

最佳答案

UIDevice *device = [UIDevice currentDevice];
if ([[device model] isEqualToString:@"iPhone"] ) {
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel:130-032-2837"]]];
} else {
    UIAlertView *notPermitted=[[UIAlertView alloc] initWithTitle:@"Alert" message:@"Your device doesn't support this feature." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [notPermitted show];
    [notPermitted release];
}

关于ios - 在 iOS 中以编程方式调用带有访问代码的电话号码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5456395/

相关文章:

iphone - 将 UIImage 以 PNG 格式保存到 iPhone 上的相册

ios4 - iPhone 中的警报甚至应用程序已关闭

ios - 如何在 ios 中合并音频和视频

ios - glDrawElements 中的参数类型 UnsafePointer<Void>

ios - 多目标 Xcode 7.3 iOS 9+ 应用程序启动屏幕 xib 问题

iphone - iOS应用内购买: Can Non-Consumable Apple Hosted Content be Free

ios - 临时 UIImage 从不清除

iphone - XCODE 基础 SDK 缺失

ios - react-native run-ios 构建卡住

ios - 以编程方式创建文本字段?