Por que é meu sizeWithFont: constrainedToSize: lineBreakMode: sempre retornando zero?
Eu estou tentando fazer um UITableViewCell que ajusta sua altura com base no comprimento de uma string que está sendo exibida, mas estou ficando preso a este método.
Aqui está o que eu tenho:
NSString *text = @"A really long string in here";
CGSize theSize = [text sizeWithFont:[UIFont boldSystemFontOfSize:18.0f] constrainedToSize:CGSizeMake(265.0f, MAXFLOAT) lineBreakMode:UILineBreakModeWordWrap];
NSString *stringHeight = [NSString stringWithFormat:@"%d", theSize.height];
Não importa o que,stringHeight
exibe como0
. o que estou perdendo?
Obrigado!