我有CCLabelTTF和NSString文本。在5日IOS sizeWithFont:返回高度大于sizeWithAttributes:7日。
if ([[[UIDevice currentDevice] systemVersion] compare:@"7.0" options:NSNumericSearch] == NSOrderedAscending)
{
dim = [string sizeWithFont:font];
}
else
{
dim = [string sizeWithAttributes:[NSDictionary dictionaryWithObject:[UIFont fontWithName:name size:(CGFloat)size] forKey:NSFontAttributeName]];
}
dim differs on 1 pixel for 5 and 7 ios