UITableView
各行に名前と各名前の画像を含む があります。特定の名前が検索されると、画像は同じもので検索されませんUITableViewCell
。最初の行またはセルのイメージは変わりません。画像も検索するにはどうすればよいですか?
検索問題の画像をアップロードしました。
[1]: http://i.stack.imgur.com/QcvtU.png "TableView"
[2]: http://i.stack.imgur.com/RmsIv.png "テーブルビューで検索"
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier ];
}
if(temp==1)
{
cell.textLabel.text = [newarray objectAtIndex:indexPath.row];
//cell.textLabel.text = [newarray2 objectAtIndex:indexPath.row];
}
else
{
cell.textLabel.text= [array objectAtIndex:indexPath.row];
cell.imageView.image = [UIImage imageNamed:[imagearray objectAtIndex:indexPath.row]];
}
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
return cell;
}