scaledValueForValue: called on a font that doesn’t have a text style set

This problem has been fixed in iOS 8.1.

Instead of spending time building a custom header/footer view, I just not apply the custom font to devices running iOS 8.0. Most people will probably have updated to iOS 8.1 anyway.

I use the following code for this:

NSOperatingSystemVersion iOS_8_1 = (NSOperatingSystemVersion){8, 1, 0};

if (![[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)]
    || [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:iOS_8_1]) {
    header.textLabel.font = [UIFont fontWithName:@"Avenir-Medium" size:header.textLabel.font.pointSize];
}

The first statement is true if the device is running an iOS version lower than 8 (since isOperatingSystemAtLeastVersion: was introduced in iOS 8.0). The second statement is true if the device if running iOS 8.1 or later. With both statements we thus only exclude devices running iOS 8.0.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)