Set UITableView Delegate and DataSource

后端 未结 5 1533
生来不讨喜
生来不讨喜 2020-12-06 01:29

This is my problem: I have this small UITableView in my storyboard:\"enter

<
5条回答
  •  春和景丽
    2020-12-06 01:46

    Presumably you're using ARC? Your myTableDelegate is only referenced in a local variable in viewDidLoad -- once that method ends, it's deallocated. (In the delegate/datasource pattern, objects do not own their delegates, so the table view's references back to your object are weak.) I wouldn't expect that alone to cause a crash, but it's likely key to your problem.

提交回复
热议问题