答案 0 :(得分:0)
按照步骤
customtableviewCell
取一个UIButton
(说btnHidePost
)(说btnSetting
)。别忘了给出限制。arrMutBtnSelected
)viewDidLoad
做 // array of bools, initially all false as not any button is selected
// arrPost is the array of your post, assumine here it is total count for your rows.
for (int i=0; i < arrPost.count; i++) {
[arrMutBtnSelected addObject:[NSNumber numberWithBool:false]];
}
cellForRow
if (arrMutBtnSelected[indexPath.row] == [NSNumber numberWithBool:true]) {
fbCell.btnSetting.selected = true;
fbCell.btHidePost.hidden = false;
}
else{
fbCell.btnSetting.selected = false;
fbCell.btHidePost.hidden = true;
}
}
5.按钮操作,
[arrMutBtnSelected removeAllObjects];
for (int i=0; i < arrPost.count; i++) {
[arrMutBtnSelected addObject:[NSNumber numberWithBool:false]];
}
[arrMutBtnSelected replaceObjectAtIndex:sender.tag withObject:[NSNumber numberWithBool:true]];