>我正在尝试打开应用程序"计算器",但我不知道方案
- (IBAction)btnColetorClick:(id)sender
{
NSString *customURL = @"calculator://";
if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:customURL]])
{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:customURL]];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"URL error"
message:[NSString stringWithFormat:@"No custom URL defined for %@", customURL]
delegate:self
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
[alert show];
}
}
本机计算器似乎没有方案。
相关:
用于在iOS应用程序中显示本机计算器的API
从另一个 App 中启动一个 App (iPhone)
你可以试试"calc://"
它适用于iOS13