You're thinking about this in the wrong way.
There are 2 pieces to this. As was said above, the first thing is make sure that in the Nib for the Cell you enter the identifier value. This ensures that the instance that's created with the Nib info has the right identifier.
The second piece is that you absolutely do NOT want the identifier to be anything other than a constant. The identifier specifies the pool from which you can take reusable cells and it makes no sense to change it. When you do the following
MyCustomCell *cell = (MyCustomCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
it tries to pull a cell from the pool specified by MyIdentifier. That's it. If there's no previously cell tagged for reuse, it returns nil and then you recreate one using the following code:
if (cell == nil) {
NSArray * MyCustomCellNib = [[NSBundle mainBundle] loadNibNamed:@"MyCustomCell" owner:self options:nil];
cell = (MyCustomCell *)[MyCustomCellNib objectAtIndex:1];
}
(which assumes you've created a nib called MyCustomCell.nib and the only thing in it apart from First Responder and File's Owner is your custom tableview cell)
This code does work, and does reuse cells properly.