Could not cast value of type 'UITableViewCell' to '(AppName).(CustomCellName)'

前端 未结 12 1745
一生所求
一生所求 2020-12-02 23:03

I\'m currently trying to create a custom table view cell using xCode 6.3 swift 1.2. For some reason in the cellforRowAtIndexPath method, I just can\'t seem to set up my cell

12条回答
  •  隐瞒了意图╮
    2020-12-02 23:14

    X Code 9.4
    Unlike one of the popular answer here this solution fixed my nightmare with custom tableview cells. If you are using storyboard and everything is hooked up correctly then you do not have to register the the custom tableView cell in viewDidLoad.

    Remove from viewDidLoad:
    self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")

提交回复
热议问题