UITableView delegate and dataSource methods not getting called

后端 未结 8 1397
野性不改
野性不改 2021-02-13 14:23

I have a UIView which contains a UITableView. The tableview\'s delegate is set to my UIView, but it never calls the delegate methods:

-(id)init {
    self = [sup         


        
8条回答
  •  情歌与酒
    2021-02-13 15:09

    Try changing your UIViewto UIViewController and in viewDidLoad, call

    [[UITableView alloc] initWithFrame:style:] to create your Table View.

    Set self as the delegate and data source like you did above, and then add this UITableView as Subview in this Controller.

提交回复
热议问题