Custom table view cell: IBOutlet label is nil

前端 未结 6 1574
走了就别回头了
走了就别回头了 2020-12-08 18:38

Consider the following simple view controller:

class ViewController: UIViewController, UITableViewDataSource {
    @IBOutlet weak var tableView: UITableView!         


        
6条回答
  •  半阙折子戏
    2020-12-08 19:07

    You should use dequeueReusableCellWithIdentifier:forIndexPath to dequeue the cells.

    If you are using storyboard to create the cells, you should not need to register the class for reuse as storyboard does it for you if you set the reuseIdentifier.

提交回复
热议问题