开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜