代码如下:主线程调用了tableView的reloadData()之后只调用了numberOfRowsInSection,没有调用cellForRowAt一直找不到解决的方法还有出错的原因,希望有大神知道原因的能指点一下,感激不尽
import UIKit
protocol SearchViewDelegate {
///点击排序按钮调用
func searchView(clickSortBtn btn: UIButton)
///选中商品调用
func searchView(clickShopCell indexPath: IndexPath)
}
class SearchView: UIView, UITableViewDataSource, UITableViewDelegate {
///代理属性
var chDelegate: SearchViewDelegate?
var snapBtn = UIButton()
let btnTitles = ["相关", "销量", "价格", "新品"]
var bottomLine = UIView()
var shopTableV = UITableView()
///模型数组
var models: [SearchShopResultModel] = []
override init(frame: CGRect) {
super.init(frame: frame)
self.backgroundColor = UIColor.chBackGroundColor
self.shopTableV.register(SearchViewShopCell.self, forCellReuseIdentifier: "searchShopCell")
shopTableV.dataSource = self
shopTableV.delegate = self
}
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
///布局子视图
override func layoutSubviews() {