iOS 7 sizeWithAttributes: replacement for sizeWithFont:constrainedToSize
well you can try this :
NSDictionary *attributes = @{NSFontAttributeName: [UIFont fontWithName:@"HelveticaNeue" size:14]};
// NSString class method: boundingRectWithSize:options:attributes:context is
// available only on ios7.0 sdk.
CGRect rect = [textToMeasure boundingRectWithSize:CGSizeMake(width, CGFLOAT_MAX)
options:NSStringDrawingUsesLineFragmentOrigin
attributes:attributes
context:nil];
This is how I did it:
// Get a font to draw it in
UIFont *font = [UIFont boldSystemFontOfSize: 28];
CGRect textRect;
NSDictionary *attributes = @{NSFontAttributeName: font};
// How big is this string when drawn in this font?
textRect.size = [text sizeWithAttributes:attributes];
// Draw the string
[text drawInRect:textRect withAttributes:attributes];