What's the procedure for properly removing a SfChart from superview.
Let said that I have the following chart:
_Chart = new SFChart ();
SFNumericalAxis primaryAxis = new SFNumericalAxis ();
_Chart.PrimaryAxis = primaryAxis;
primaryAxis.Interval = new NSNumber (25);
SFNumericalAxis secondaryAxis = new SFNumericalAxis ();
_Chart.SecondaryAxis = secondaryAxis;
secondaryAxis.Minimum = new NSNumber (2);
secondaryAxis.Maximum = new NSNumber (5);
secondaryAxis.Interval = new NSNumber (0.5);
ChartAreaDataSource dataModel = new ChartAreaDataSource ();
//from the sample app
_Chart.DataSource = dataModel as SFChartDataSource;
If I try to remove the graph form the superview the app instantly crash with a SIGSEGV error.
Alternatively, if I comment the datasource lines (defeating the purpose of the chart) I can remove it from the super view without causing it to crash the application.
If I try to override the RemoveFromSuperview function in my view and set the datasource to null I got a null reference exception.
public override void RemoveFromSuperview () {
_Chart.DataSource = null; // throw null reference exception
base.RemoveFromSuperview ();
}
Thanks for your input