identifying Button selection of each row in Tableview?
Posted
by senthilmuthu
on Stack Overflow
See other posts from Stack Overflow
or by senthilmuthu
Published on 2009-12-07T05:09:15Z
Indexed on
2010/05/08
22:08 UTC
Read the original article
Hit count: 174
iphone
|iphone-sdk
hi,i coded like
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UIButton *btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
btn.frame = CGRectMake(230.0f, 4.0f, 60.0f, 36.0f);
[btn setTitle:@"OK" forState:UIControlStateNormal];
[btn setTitle:@"OK" forState:UIControlStateSelected];
[btn addTarget:self action:@selector(onClickRename:) forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:btn];
return cell;
}
but if the user selects the button on particular row, i can change that image through onClickRename...but can i get inwhich row's image has been touched through
- (void)tableView:(UITableView )tableView didSelectRowAtIndexPath:(NSIndexPath)indexPath ?
© Stack Overflow or respective owner