Question: I know there are bunch of questions here related to this topic but i couldn't find any that matches my issue. I have subclass of `UITableViewCell` named "CustomTableViewCell".

The below mentioned code works fine however, i have check marks in my cell and i wanted to stop the reusability since the max number of cells will not exceed 25, hence it would no affect the performance, i guess after many searches, i found out that i have to either remove the tableView `dequeueReusableCellWithIdentifier` method or just change the identifier to nil, but unfortunately, i get empty cell when i i do that, and my app crashes what am i missing here?

This works fine BUT it reuses cell.

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

    static NSString *CellIdentifier = @"CustomCell";

    CustomTableViewCell *cell = (CustomTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[CustomTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    ...
    ...
    ...
    ...

    return cell;
}

```

While instead, this code crashes:

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

    static NSString *CellIdentifier = @"CustomCell";

    CustomTableViewCell *cell = (CustomTableViewCell *)[tableView dequeueReusableCellWithIdentifier:nil];
    if (cell == nil) {
        cell = [[CustomTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    ...
    ...
    return cell;
}

```

Answer: 
Implement prepareForReuse
-------------------------

I strongly recommend you to use the reuse pattern, in my opinion its just bad practice not to do it. I guess the real reason that you avoid to use the reuse pattern is that you see 'old' state in your custom cells when they are being reused.

To avoid this, you should implement/override the prepareForReuse method in your custom cell, in this method you set all your custom properties to their default state.

In the cellForRowAtIndexPath you just reuse the cells and set your custom properties to their values.

```
- (void)prepareForReuse() {
    [super prepareForReuse];

    //Set your custom properties to their default state
    self.custom1 = ...;
    self.custom2 = ...;
}

```
You can do something like this,
-------------------------------

1) `@property (nonatomic, strong) NSMutableDictionary *cellArray;`

2)in viewDidLoad,

```
self.cellArray = [[NSMutableDictionary alloc] init];

```

3)

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

    static NSString *CellIdentifier = @"CustomCell";

    CustomTableViewCell *cell = nil;
    id c = [self.cellArray objectForKey:[NSNumber numberWithInt:indexPath.row]];
    if(!c){
        cell = [[CustomTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];

    cell.textLabel.text = @"init part goes here";
    ...
    ...
    ...
    ...
        [self.cellArray setObject:cell forKey:[NSNumber numberWithInt:indexPath.row]];
    }else{
        cell = (CustomTableViewCell *) c;
    }

    return cell;
}

```