gpt4 book ai didi

ios - TableView 注册 - UINib 参数标签 '(nibName:, Bundle:)' 不匹配任何可用的重载

转载 作者:搜寻专家 更新时间:2023-11-01 05:55:52 24 4
gpt4 key购买 nike

尝试向我的项目添加自定义单元格时,以下代码在寄存器行返回错误 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com