在我的應用程序中,我在一個地方顯示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? –