开发者

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");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜