Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatal error: value failed to bridge from Swift type to a Objective-C type #783

Closed
chrisozenne opened this issue Feb 29, 2016 · 1 comment

Comments

@chrisozenne
Copy link

I get a crash with the following line of code from ChartXAxisRenderer.swift:

let labelSize = widthText.sizeWithAttributes([NSFontAttributeName: xAxis.labelFont])

The crash is:

fatal error: value failed to bridge from Swift type to a Objective-C type

When I po xAxis.labelFont the output is <uninitialized>.

This crashes only when I use a custom font like so:

xAxis.labelFont = [UIFont fontWithName:@"SourceSansPro" size:12];

Using the system font does not crash.

@chrisozenne
Copy link
Author

Turns out the font name was bad. Perhaps Charts could handle an invalid font more gracefully? Fall back to a default font or throw an exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant