Logging a particular row in didSelectRowAtIndexPath
In the method for
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// do stuff here
}
I have a grouped table view. If I wanted Row 1 of Section 1 to spit out an NSLog
, how would I do that? Also, would it be different if I wanted Row 2 of Section 3 to make a log? So far, I've only been using this method to transition 开发者_StackOverflowbetween nibs.
Dirt simple:
if(indexPath.row == 1 && indexPath.section == 1) {
NSLog(@"Awesomeness");
} else if(indexPath.row == 2 && indexPath.section == 3) {
NSLog(@"Something more awesome");
}
精彩评论