尝试向我的项目添加自定义单元格时,以下代码在寄存器行返回错误 UINib Argument labels '(nibName:, Bundle:)' do not match any available overloads
。
Xcode 9 测试版 6
@IBOutlet var MTableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
MTableView.delegate = self as? UITableViewDelegate
messageTableView.dataSource = self
MTableView.register(UINib(nibName: "MCell", Bundle: nil), forCellReuseIdentifier: "CustomCell")
}
最佳答案
你混合了大写和小写。在 Swift 中,所有函数参数都以小写字母开头。改变
UINib(nibName: "MCell", Bundle: nil)
到
UINib(nibName: "MCell", bundle: nil)
关于ios - TableView 注册 - UINib 参数标签 '(nibName:, Bundle:)' 不匹配任何可用的重载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46175833/