我在表格视图单元格中有一个按钮,以及使用按钮的标题文本进行呼叫的以下操作
- (IBAction)makeCall:(id)sender
{
UIButton *button = (UIButton *)sender;
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",[button titleForState:UIControlStateNormal]]]];
}
这是失败的(注意:makeCall 操作确实被调用,并且调试按钮的标题文本会给出正确的值)。
从视图上的按钮(即不在表格单元格中)使用 SAME 操作有效。
有谁知道为什么?
谢谢。