Consitent crash using TKDataSource - Xamarin IOS

2 posts, 0 answers
  1. Melina
    Melina avatar
    6 posts
    Member since:
    Nov 2012

    Posted 23 Jun 2015 Link to this post

    Have already submitted this as a bug in the general area.  Thought I would post here for more impact. 

    I am exploring the use of the Data source to try to get more performance out of the Chart. But I can only call reload twice. After that it goes into an infinite loop calling the Data source GetSeries, GetPoints, etc.  This is 100% repeatable 

    This is the C# wrapper used with Xamarin IOS 

    I did a quit modification of the Telerik sample code : TKChart binding with delegate.

    public class BindingWithDelegate: ExampleViewController
    {
            TKChart chart

        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();
        
            this.chart = new TKChart (this.ExampleBounds);
            chart.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            chart.DataSource = new ChartDataSource ();
            chart.Legend.Hidden = false;
            chart.Legend.Style.Position = TKChartLegendPosition.Top;
            chart.Legend.Container.Stack.Orientation = TKStackLayoutOrientation.Horizontal;
            this.View.AddSubview (chart);
        }

            public override void ViewDidAppear(bool animated) {
                base.ViewDidAppear(animated);
                this.DoReloads(2); // <- this works up to 2. If you put 3 then it all goes away eventually
            }

            private void DoReloads(int count) {
                for (int i = 0; i < count; i++) {
                    this.chart.ReloadData();
                }

                // This dialog will never show if the number is 3 or higher.
                new UIAlertView("Reloaded", string.Format("Did reload {0} times", count), null, "Exit", null).Show();
            }

    ...

    There is more of the telerik code that I did not cut and paste.  You can do your own sample and drive it with a button event, etc.  100% repeatable 

    If you put console instrumentation in the data source you will see it is being called infinitely.  Crash is probably due to memory consumption

  2. Sophi
    Admin
    Sophi avatar
    99 posts

    Posted 24 Jun 2015 Link to this post

    Hi Melina,

    I confirm that there is an issue in TKChart when calling the reloadData method multiple times. The issue will be addressed in our next release. Check the full answer to your question in your support ticket regarding the same issue

    Regards,
    Sophi
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. DevCraft banner
Back to Top