I am trying to transition from a view controller to a table view controller programmatically (vs. with a storyboard segue), using this code:
[self.navigationController pushViewController:photosTVC animated:YES];
However, I get an "assertion error" when the table view controller is loading; specifically, on the second line of this method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Photo";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
...
The table view controller loads fine when transitioning to it using a segue, but just not when I transition this way. Any ideas I could try would be much appreciated!
Thanks for reading.
EDIT: The full error text is below:
Assertion failure in -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:4460