UIFont 有一个 lineHeight. 先用UILabel的 sizeThatFits 计算出最佳大小。然后用高度/lineHeight就是行数咯
CGFloat labelHeight = [self.testLabel sizeThatFits:CGSizeMake(self.testLabel.frame.size.width, MAXFLOAT)].height;
NSNumber *count = @((labelHeight) / self.testLabel.font.lineHeight);
NSLog(@"共 %td 行", [count integerValue]);