-(UITableViewCell *) tableView :( UITableView *) tableView cellForRowAtIndexPath :( NSIndexPath *) if the indexPath is not executed, uitableviewcell
-(UITableViewCell *) tableView :( UITableView *) tableView cellForRowAtIndexPath :( NSIndexPath *) there are only three reasons why indexPath is not executed.
1. If delegate is not set, you must have self. tableView. delegate = self.
2. The number of sections and rows is returned as 0, or there is a conflict.
3. There is a problem with the frame of tableView, such as bit (0, 0, 0)
I encountered a strange problem, because I like to add constraints in the code, so they are all first
InitWithFrame: CGRectZero, and then add constraints. In this way, when initializing tableView, its frame is (0, 0, 0, 0), so cellForRowAtIndexPath is not executed.
Later I thought about some methods, and there was always a problem. Later I found:
The added constraint does not take effect in viewDidLoad and viewWillAppear. It only takes effect in viewDidAppear. This may be the disadvantage of adding constraints to the code.