Our app is crashing when we display an SFChart on iOS. The crash eventually occurs, but is accelerated if we dispose the chart - for instance, by replacing the content of the parent which contained the SFChart and we see this error logged:
`Unhandled managed exception: Cannot access a disposed object.
Object name: 'SFChart'. (System.ObjectDisposedException)
at Foundation.NSObject.get_SuperHandle () <0x10552652c + 0x000a8> in <149d342757e54bfaa120bb42afe18369#67499d380b924bd7106c0381098f29cd>:0
at UIKit.UIView.get_Superview () <0x1054f3f74 + 0x00033> in <149d342757e54bfaa120bb42afe18369#67499d380b924bd7106c0381098f29cd>:0
at Syncfusion.SfChart.iOS.SFChart.DisposeChart () <0x1082f501c + 0x00e2f> in <2e2cd393356848fabcb0c5dfc0024e54#67499d380b924bd7106c0381098f29cd>:0
at Syncfusion.SfChart.iOS.SFChart.Dispose (System.Boolean disposing) <0x1082f4ff8 + 0x00017> in <2e2cd393356848fabcb0c5dfc0024e54#67499d380b924bd7106c0381098f29cd>:0
at Foundation.NSObject.Finalize () <0x1055259e4 + 0x00023> in <149d342757e54bfaa120bb42afe18369#67499d380b924bd7106c0381098f29cd>:0
We're using version 20.2.0.36 of Syncfusion.Xamarin.SfChart.IOS. We only see this error when we create an AppCenter build of our app, not in debug builds. So far, we haven't managed to identify the difference between the two builds that leads to the error, so I don't have a sample app to help you repro the issue.
Any idea how we can fix this?
Hi Julie Cantin,
Thank you for bringing this issue to our attention. In order to assist you in resolving this issue, we would like to gather more information about your setup. Specifically, we would like to know how you are setting up your assembly in your project. Are you using SfChart.IOS alone or in conjunction with SfChart.XForms? Please share us these details. In the mean time we will validate and respond back to you within two business days, January 17, 2023.
Regards,
Raja.
Hello Raja,
We are using SfChart.IOS alone without SfChart.XForms.
Julie
Hello again Raja,
We have found that there was interaction with a private library we have developed. Although we don't fully understand how this works, a modification to the way we use that library has fixed the issue. Thank you for your support!
Julie
Hi Julie,
We are happy to hear that the problem has been resolved by yourself. Please let us know if you need further assistance. As always, we are happy to help you out.
Regards,
Preethi R