UITableView reloadData does not seem to cause cellForRowAtIndexPath: to be called

cocoa-touch, ios, uitableview

Solution

When things like this happen to me, it's usually because I'm calling `-reloadData` outside of the main thread.

Problem

I am currently writing an app, using storyboards, that contains two `UITableView`s within the same window. When running the application, the first `UITableView` will populate with a number of "Registration Numbers". When the user taps on a cell, then the second `UITableView` is supposed to populate with detail about the selected cell. When tapping a number in the first table I have a method that drives the: ``` [mySecondTableView reloadData] ``` Which it does. I am under the impression that when invoking the `reloadData` command, it should then call both: ``` - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section ``` and ``` - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath ``` The first fires, but the second won't. I have both the data source and delegate wired to self. I am not sure what I am missing. Are both methods meant to fire?

Original source

Related problems