【发布时间】:2016-10-08 23:25:20
【问题描述】:
我正在使用可扩展的 tableView。其中一个单元格将用于在 safari 中打开 URL 链接的按钮。按钮 IBOulet 在 WebsiteCell 类中,数据和视图控制器在 Detail View 中。
在详细视图类中,我在尝试调用显示为websiteCell.venueURL(UIButton) 的按钮时出错。错误显示“通话中的额外参数”。
这里应该用什么来代替 UIButton?
WebsiteCell 类
class WebsiteCell: UITableViewCell {
@IBAction func venueURL(sender: UIButton) {
}
详细视图类
else if indexPath.row == 3 {
let websiteCell = tableView.dequeueReusableCellWithIdentifier("websiteCell") as! WebsiteCell
let venueURL = venues!["URL"] as! String
websiteCell.venueURL(UIButton){
UIApplication.sharedApplication().openURL(NSURL(string: venueURL)!)
}
【问题讨论】: