开发者

how to call a number when you click it same as iphone phonebook?

开发者 https://www.devze.com 2023-02-24 08:55 出处:网络
I want to call a number when click that number(UIButton), just as in iphone phoneboo开发者_StackOverflow中文版k?NSURL *telURL = [NSURL URLWithString:@\"tel:1-234-567-8901\"];

I want to call a number when click that number(UIButton), just as in iphone phoneboo开发者_StackOverflow中文版k?


NSURL *telURL = [NSURL URLWithString:@"tel:1-234-567-8901"];
[[UIApplication sharedApplication] openURL:telURL];


Example:

[[UIApplication application] openURL:[NSURL URLWithString:@"tel://99887766"]];

Add it to the IBAction.


- (IBAction)buttonClicked
{
NSURL *telURL = [NSURL URLWithString:@"tel:urNumber"];
[[UIApplication sharedApplication] openURL:telURL];

}
0

精彩评论

暂无评论...
验证码 换一张
取 消