Why doesn’t this work? It always returns 18 no matter the length of the string. There is this thread, but not a definitive answer.
NSString * t = @"<insert super super long string here>";
CGSize size = [t sizeWithFont:[UIFont systemFontOfSize:14.0] forWidth:285 lineBreakMode:UILineBreakModeWordWrap];
NSLog(@"size.height is %f and text is %@", size.height, t);
Thanks,
Todd
Use
sizeWithFont:constrainedToSize:lineBreakMode:instead.