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];
}
精彩评论