scaledValueForValue: called on a font that doesn't have a text style set scaledValueForValue: called on a font that doesn't have a text style set objective-c objective-c

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.


Okay I finally figured it out.

This occurs when grouped table views have section headers and possibly footers. As a temporary workaround I am just removing the headers/footers from the grouped tableviews, but if you really need the font you can create a custom header view by overriding the "viewForHeaderInSection", and setting the font on your custom view's label.

Still, this is definitely a bug in iOS 8 and hopefully it will be fixed soon.


Like everyone here, applying the fix in other answers caused the font setting to be ignored. What I ended up doing was having my own UITableViewHeaderFooterView (Where it seems the cause for the crash is coming from) subclasses that had a label that I added myself. I then used this label instead of the textLabel property inherited from UITableViewHeaderFooterView, set up the auto layout constraints, set the font, and all was right once again (though not what I would consider ideal). I'll add again that this seems to be iOS 8 unique.