UITableView delegate and dataSource methods not getting called

后端 未结 8 1395
野性不改
野性不改 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 14:56

    I ran into the same issue once, what silly mistake I did was inside initWithCoder I called [super init]. TableView was in xib

    -(id) initWithCoder:(NSCoder *)aDecoder
    {
        self = [super init]
    }
    

    Instead of

    -(id) initWithCoder:(NSCoder *)aDecoder
    {
        self = [super initWithCoder:aDecoder];
    }
    

    Just check if that's not the case

提交回复
热议问题