-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Label on Limit Lines cause crash #181
Comments
P.S: My app supports iOS 7, so I dragged the swift files into my project instead of importing framework. |
You should really edit your stack trace, yours is loosing the focus. Paste only helpful log.
Add some breakpoints to try. My app also supports iOS 7 and on my side, my project is also Objective-C based, and ios-charts works fine. So it should be your project issue. Could you try turning off swift optimization and re-compile? |
Hi Xuan, I have set optimization level to none and re-compile. The code still crash but now at least my Xcode isn't shut down. The crash happened in ChartUtils line 133, the error in console is "fatal error: value failed to bridge from Swift type to a Objective-C type" |
hmm, never see such issue. But I guess stack overflow can provide more help? At least you should edit your post... delete useless logs. This is how it bridge on my side: - (SWIFT_NULLABILITY(nonnull) instancetype)initWithLimit:(double)limit label:(NSString * __nonnull)label OBJC_DESIGNATED_INITIALIZER; I am wondering, it's a double type, and you are giving 40.6f as float type? Just try 40.6 |
Hi I have narrowed down the cause of the crash: line1.valueFont = [UIFont fontWithName:[NSString stringWithFormat:@"%@-Regular", CLAppFontFamily] size:10.0f]; If I comment out the line above, or replace it with: line1.valueFont = [UIFont systemFontOfSize:10.0f]; My code would run just fine. |
what is CLAppFontFamily... You may need to check if you have the font. I am no expert on this. |
Your font does not exist, and it returns |
Thanks for the help, have resolved this crash. |
ChartLimitLine *line1 = [[ChartLimitLine alloc] initWithLimit:40.6f];
This works fine,
however if I put a label on my limit lines like this
ChartLimitLine *line1 = [[ChartLimitLine alloc] initWithLimit:40.6f label:@"test"];
My app will crash at ChartUtils.swift drawText function. And my Xcode is subsequently shutdown.
The text was updated successfully, but these errors were encountered: