EXC_BAD_ACCESS en heightForRowAtIndexPath iOS

Estoy trabajando en una aplicación donde tengo una subclase personalizada de UITableViewCell. Quiero que la altura de la celda sea dinámica en función del texto que contiene. Intento hacer eso en mi método heightForRowAtIndexPath. Pero tengo algunos problemas, el siguiente código causa y el error EXC_BAD_ACCESS (código = 2 dirección = 0xb7ffffcc).

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{

    PostCell *cell = (PostCell *)[tableView cellForRowAtIndexPath:indexPath];

    CGSize postTextSize;
    if (![cell.postText.text isEqualToString:@""]) {
        postTextSize = [cell.postText.text sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(cell.postText.frame.size.width, 200)];
    } else {
        postTextSize = CGSizeMake(cell.postText.frame.size.width, 40);
    }

    return postTextSize.height + cell.userName.frame.size.height + 10;
}

Si por el contrario yo tengo:

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{   
    return 100;
}

Funciona.

Parece que se está estrellando en esta línea:PostCell *cell = (PostCell *)[tableView cellForRowAtIndexPath:indexPath];, y no se por que He intentado construir limpio y reiniciar el simulador, pero ninguno ha funcionado. ¿Alguna idea de por qué esto está sucediendo?

Respuestas a la pregunta(5)

Su respuesta a la pregunta