'+ systemFontSize:'找不到

时间:2011-03-23 13:50:39

标签: objective-c xcode warnings

Method '+systemFontSize:' not found (return type defaults to 'id')
'UIFont' may not respond to '+systemFontSize:'

在Google上搜索确切的词组不会得到任何相关或不相关的结果。我发现最近的是其他人遇到与label.font = [UIFont systemFontSize:12.0];不同的问题作为解决方案。这就是我现在要做的,但是Xcode对此大吼大叫。

如果重要,我正在使用这本书:Professional iPhone and iPad Database Application Programming
如果确实如此,我会感到惊讶,但你去了。

2 个答案:

答案 0 :(得分:5)

我认为您正在寻找systemFontOfSize:,而不是systemFontSize:。所以,你这样设置:

label.font = [UIFont systemFontOfSize:12.0];

答案 1 :(得分:1)

the documentation for UIFont。您可能正在寻找systemFontOfSize:,请注意“Of”。