我在我的申請分組的表視圖具有兩個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