我想知道为什么会收到此错误:
ARC 不允许将“int”隐式转换为“id”
self.versionButton.titleLabel.font = [UIFont fontWithName:@"AdobeClean-Light" size:self.versionButton.titleLabel.font.pointSize]; <- Implicit conversion of 'int' to 'id' is disallowed with ARC
查看 UIFont 的头文件,我看到“fontWithName”想要一个 CGFloat
+ (UIFont *)fontWithName:(NSString *)fontName size:(CGFloat)fontSize
{
return [self fontWithNSFont:[NSFont fontWithName:fontName size:fontSize]];
}
查看 UIFont 的头文件,我看到“pointSize”返回一个 CGFloat
- (CGFloat)pointSize
{
return CTFontGetSize(_font);
}
我正在导入导入“UIFont.h”的 UIKit