A small issue over here i have 4 sections when i click on the first TableCell of a section (got 4 sections) the NSlogs output is:
2012-02-20 20:33:16.870 [8880:c07] 00
Can i do something like;
if switch(indexPath.row == 0) {
case
} else if(indexPath.row == 1) {
case
}
to ‘link’ each Tablecell to another function?
The problem is when i use the code ;
case 0:
NSLog(@"00");
break;
each first Tablecell of a section gives me the NSlog 00
UIViewController *controller;
switch(indexPath.row) {
case 0:
NSLog(@"00");
break;
case 1:
NSLog(@"01");
break;
case 2:
NSLog(@"02");
break;
case 3:
NSLog(@"03");
break;
case 4:
NSLog(@"04");
break;
}
I think you are looking for something like this:
The
ifstatement separates the execution path on thesection, and thenswitchfurther separates it on therow. If the number of sections is significant, you could use an outerswitchoutside of the inner switches.