No index path for table cell being reused

前端 未结 13 1505
执念已碎
执念已碎 2021-02-04 05:18

This started to happen out of the blue. Any ideas: Code:

CUSTOMCLASSNAME (I have replaced the actual class name as it contains the name of the client.)

Initialis

13条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-04 06:10

    It helped me in swift 2.1

      func tableView(tableView: UITableView, viewForHeaderInSection section: Int) -> UIView {
                let headerCell:SBCollapsableTableViewHeader = self.friendsInfoTableView.dequeueReusableCellWithIdentifier("HeaderCell") as! SBCollapsableTableViewHeader
                let containerView = UIView(frame:headerCell.frame)
                headerCell.delegate = self
                headerCell.titleLabel.font = UIFont.boldSystemFontOfSize(15)
                headerCell.titleLabel.text = "\(self.ObjectArray[section].sectioName)"
                headerCell.collapsedIndicatorLabel.text = collapsed ? "+" : "-"
                headerCell.tag = section
                headerCell.backgroundColor =  UIColor(red:72/255,green:141/255,blue:200/255,alpha:0.9)
                containerView.addSubview(headerCell)
                return containerView
        }
    

提交回复
热议问题