在我的应用程序中,我在一个地方显示UIImage
和标签表格视图单元格。它工作正常。同时点击行我尝试隐藏一个UIImage视图并显示另一个UIImage视图。隐藏的UIImageView,同时点击表格视图单元格
代码,我尝试是
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *simpleTableIdentifier = @"AddFrdsGroup";
AddFriendsCell *cell = (AddFriendsCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"AddFriendsCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
if(cell.chkAddFrdsYes.hidden==YES)
{
cell.chkAddFrdsNo.hidden=YES;
cell.chkAddFrdsYes.hidden=NO;
}
else
{
cell.chkAddFrdsNo.hidden=YES;
cell.chkAddFrdsYes.hidden=NO;
}
}
解释一点点? –
我是绑定表视图单元格到表视图。它在页面加载时工作正常。之后,如果点击单元格,它想要隐藏一个UIImage视图并显示其他UIImage视图。 –
为什么你同时使用'[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]'和'NSArray * nib = [[NSBundle mainBundle] loadNibNamed:@“AddFriendsCell”owner:self options:nil]; cell = [nib objectAtIndex:0];'in didSelectRow? –