私のcellForRowAtIndexPathで
- (UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
//...do cell setup etc.
UIImage *iconthumbNail = [UIImage imageNamed:@"icon.png"];
UIImageView * iconimgView = [[UIImageView alloc] initWithFrame:CGRectMake(265, 34, 25, 25)];
[iconimgView setImage:iconthumbNail];
//imgView.image = thumbNail;
[cell addSubview:iconimgView];
[iconimgView release];
// add a few more UIImageViews to the cell
}
だから私の中で
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:NO];
UITableViewCell * theCell = [tableView cellForRowAtIndexPath:indexPath];
for (UIView * b in cell.subviews)
{
if ([b isKindOfClass:[UIImageView class]])
{
// how do I check that its 'iconImgView' so that I can change it?
}
}
そこで、cellForRowAtIndexPathにUIImageViewを追加し、そのテーブルセルが選択されたときに、セル内の画像の1つ「iconImgView」を変更したいのですが、このセルに存在する他のUIImageViewからこのUIImageViewを識別するにはどうすればよいですか?
どうもありがとう、-コード