Strange error when adding items to prototype cells in storyboard-IB

前端 未结 7 1157
甜味超标
甜味超标 2020-12-13 13:33

I have quite a large project (~20 scenes). One of which is a TableViewController with a custom UITableViewController class. I have given the cell a reuse identifier, and add

相关标签:
7条回答
  • 2020-12-13 14:08

    In fact you can't just make an outlet from a dynamic cell prototype in the UITableView delegate view controller.

    You'll have to subclass UITableViewCell and then attribute this class to your prototype.

    Then you can Ctrl-Drag from the Label to the UITableViewCell subclass header file.

    Finaly you can access to this outlet in the delegate code after having imported the UITableViewCell header file in it.

    This is documented by Apple there at "The Technique for Dynamic Row Content" section.

    0 讨论(0)
提交回复
热议问题