I am having an app in which I am showing some data in my tableview as shown in the ScreenShot1 below.

Screenshot1.

![enter image description here](https://i.stack.imgur.com/0UO3G.png)

Now I am having an imageview On my each tableview cell.

If I select any of the cell from tableview, I want an image on that selected cell as shown in screenshot2 below.

Screenshot2.

![enter image description here](https://i.stack.imgur.com/JHNu5.png)

Now If I select any other cell form tableview. I want to set my imageview's image only on those selected cells as shown in Screenshot3 below.

![enter image description here](https://i.stack.imgur.com/sgXga.png)

Below is the code I am doing.

```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

    if (cell == nil) {

        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

    }
   lblRecipe  = [[UILabel alloc] initWithFrame:CGRectMake(50, 5, 600, 32)];

    lblRecipe.backgroundColor = [UIColor clearColor];

    lblRecipe.font = [UIFont systemFontOfSize:20.0f];
    [cell.contentView addSubview:lblRecipe];
   checkedimg=[[UIImageView alloc]initWithFrame:CGRectMake(40, 20, 500, 5)];

    [cell.contentView addSubview:checkedimg];
   lblRecipe.text = [array objectAtIndex:indexPath.row];
  return cell;

}

```

On Tableview's didselect method, what should i keep to have this kind of a functionality?

I searched a lot and there are lots of questions for this but couldn't find one for this. 

So Please help me on this. 

Thanks in advance.