As indicated in the code below, what I'm trying to do is access a table view cell from within a switch-case statement. The line where I do that is bolded below. Note that the bolded line of code works if I move it out of the switch-case statement, and no other errors are generated. I tried cleaning the project, but to no avail.
Code:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString *segueIdentifier;
NSInteger row = [indexPath row];
NSInteger section = [indexPath section];
if (section < [[self elements] count] - 1)
{
switch (row) {
case 0:
[B]UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];[/B]
segueIdentifier = @"VCSegue1";
break;
case 1:
segueIdentifier = @"VCSegue3";
break;
default:
break;
}
}
else
{
segueIdentifier = @"VCSegue4";
}
[self performSegueWithIdentifier:segueIdentifier sender:[NSNumber numberWithInteger:[indexPath section]]];
}
Last edited: