我有一个表视图,在每一行中有两个单选按钮在那里,用于选择单选按钮需要计算节号和行号,并在当前的逻辑上到第9行它的工作正常,但第9行后它没有改变单选按钮图像。iphone表视图问题与index.section和index.row
这里是我的一块逻辑实现代码。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
cell._option1Btn.tag = ((indexPath.section+1)*10)+(indexPath.row+1);
cell._option2Btn.tag = ((indexPath.section+1)*10)+(indexPath.row+1);
return cell;
}
-(void) respondToRightBtnAction:(UIButton*) sender {
if(debug)NSLog(@"In the Right button clicked method");
if(debug)NSLog(@"left button in %d row is YES", sender.tag);
int section = (sender.tag/10 -1);
int row = (sender.tag%10 -1);
}
你在每个部分有多少行? – taskinoor