Custom table view cell: IBOutlet label is nil

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

Consider the following simple view controller:

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


        
6条回答
  •  庸人自扰
    2020-12-08 18:55

    Register your nib like this:

    let bundle = Bundle(for: type(of: self))
    let nib = UINib(nibName: "PickerCell", bundle: bundle)
    collectionViewPicker.register(nib, forCellWithReuseIdentifier: "cell")
    

提交回复
热议问题