CellForRowAtIndexPath is not invoked

后端 未结 2 1360
走了就别回头了
走了就别回头了 2021-01-29 14:51

I\'m writing an app hat has many views and I used sliding views library (ECSlidingViews). The problem is when I fill an array with objects and fill the table with t

相关标签:
2条回答
  • 2021-01-29 15:28

    Once check that you reframed the tableview in ViewWillAppear. Some times if we set out of frame, CellForRowAtIndexPath will not call.

    0 讨论(0)
  • 2021-01-29 15:30

    First of all , it's not numberOfRowsAtSection and numberOfTableView. It's numberOfSectionsInTableView and numberOfRowsInSection.

    Things you can do :

    1) NSLog your numberOfRowsInSection. Note that , If it's "0" then your cellForRowAtIndexPath is never going to be called.

    2) If you are using your UITableView inside some UIView then you should add :

    [self.view addSubview:table];
    

    3) Don't Forget to include :

    @interface yourViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>
    
    0 讨论(0)
提交回复
热议问题