-
-
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
App/Xcode crashing when charts are loaded #410
Comments
Have you checked do you feed wrong dataEntry? It looks like you add ChartDataEntry object but it should be BarChartDataEntry. Check your dataSet first. |
We didn't change anything except the version of Xcode, our app is already on the store working and then we wanted to make it Xcode 7 compatible and it just dies now. |
Then you need to debug or provide more info here... I am still thinking it's wrong data entry class you used. Have you tried the latest master branch? It's been upgraded for swift 2.0 |
Yes, after we upgraded to the latest charts and the new version of Xcode, everything went haywire. I don't understand why it would start breaking now when we've had an app on the App Store for about 3 weeks that's worked perfectly fine. |
I ran into the exact same issue. |
@BrandonShega and @davidck, we need more info and logs, and maybe the steps to reproduce it. You are welcome to debug more, since the error message gives you hint. |
@liuxuan30 It looks like it's crashing when we make an array by copying the items of another array. For example we have our array of BarChartDataEntry items and we make a copy of it: NSMutableArray *currentDataCopy = [[NSMutableArray alloc] initWithArray:self.dashboardItem.currentGraphData copyItems:YES]; Which is then calling public override func copyWithZone(zone: NSZone) -> AnyObject {} and this is the method that is crashing and we get the error above in the console about casting. Any help is greatly appreciated! @davidck Is this what you are doing as well? |
@BrandonShega I've solved it temporarily by removing lines of codes from the Swift to Obj-C bridging headers. In the generated Swift file, it seems it's holding duplicated references. After removing them, it worked, however, if I rebuild the source, the issue will happen again due to the file being wrongly generated. The issue can be about a mixture of my setup due to my Obj-C project with Cocoapods installed mix with a direct inclusion of the ios-charts framework directly into my project. |
We solved it temporarily by not making copies of the data, maybe these are unrelated issues. |
@BrandonShega seems you are closing to the root cause, you may need to provide a custom copyWithZone function, I am thinking if the ChartEntry needs one. |
We recently updated our app for Xcode 7 and the latest iOS Charts on Swift 2.0 and every time our app loads, it crashes and then Xcode crashes.
The error message that we are receiving is
This is on line 134 in the BarChartDataEntry.swift file.
Any insight would be greatly appreciated.
The text was updated successfully, but these errors were encountered: