The above solution is now deprecated. Check this for iOS 7+
sizeWithFont:constrainedToSize:lineBreakMode
is deprecated now. Use below code snippet,
UIFont *font=[UIFont fontWithName:@"Arial" size:16.f];
NSString *name = @"APPLE";
CGSize size = [name sizeWithAttributes:@{NSFontAttributeName:font}];