我在我的申请分组的表视图具有两个sections.First一个由一个行的,而第二个与5.I已经添加按钮的细胞,这样,`如何在点击某个特定单元格时更改该按钮?
UIButton *newBtn=[UIButton buttonWithType:UIButtonTypeCustom];
[newBtn setFrame:CGRectMake(5,10,35,30)];
[newBtn setImage:[UIImage imageNamed:@"icon.png"] forState:UIControlStateNormal];
[newBtn addTarget:self action:@selector(selector:) forControlEvents:UIControlEventTouchUpInside];
newBtn.tag=4;
[cell.contentView addSubview:newBtn];
Now in that selector methode i need to change it with another image.I am trying to do that in this way
UITableViewCell *cell=(UITableViewCell *)[sender superview];
NSIndexPath *path=[self.mtableview indexPathForCell:cell];
`可是瓶颈一些point.Can任何机构点我在赖特的方向吗?
什么是你的行动方法按钮? –
检查我的答案。 – iDev