【发布时间】:2015-06-26 07:23:22
【问题描述】:
我在这里尝试用功能块替换“@selector”。但是这样做会显示一个错误:
错误:将 'void (^)(UIButton *__strong)' 发送到不兼容的参数 type 'SEL'
请指导如何直接放置功能块,而不是使用“@selector”。
[_contactPhoneButton addTarget:self
action:^(UIButton *sender) {
NSString *phoneNumber = [@"tel://" stringByAppendingString:sender.titleLabel.text];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:phoneNumber]];
}
【问题讨论】:
标签: ios objective-c