Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:

前端 未结 22 1323
长情又很酷
长情又很酷 2020-11-22 10:10

So I was making an rss reader for my school and finished the code. I ran the test and it gave me that error. Here is the code it\'s referring to:

- (UITableV         


        
22条回答
  •  野性不改
    2020-11-22 10:48

    Working with Swift 3.0:

    override func viewDidLoad() {
    super.viewDidLoad()
    
    self.myList.register(UINib(nibName: "MyTableViewCell", bundle: nil), forCellReuseIdentifier: "Cell")
    }
    
    
    
    public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell = myList.dequeueReusableCell(withIdentifier: "Cell", for: indexPath as IndexPath) as! MyTableViewCell
    
    return cell
    }
    

提交回复
热议问题