I created a tableviewcontroller to handle 4 static cells in a tableview. The tableview is positioned right below the 4 cells. However the last cell, 4th cell, is optional based on the 3rd cell's result.
The picker returns a value and when it does, it reloads the tableview to activate the 4th cell should the value be correct.
When I run the app it crashes on loading the SettingsViewController with this error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
I thought I didnt need reuse identifiers if I had static cells?
Here is the relevant code:
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if(self.showLastCell)
{
return 4;
}
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
return cell;
}