Calendar Crashing in iOS

9 posts, 0 answers
  1. Joe
    Joe avatar
    11 posts
    Member since:
    Jul 2015

    Posted 23 Oct 2015 Link to this post

    You get the following exception in iOS when you open a new calendar and very quickly select a date (as fast as possible).  This doesn't seem to happen in Android.  To give full disclosure, I'm using a static ObservableCollection to load appointments to the calendar.  The collection isn't loaded every time the calendar is displayed because it may have already been updated in the last 30 minutes.  However, I can recreate the problem with and without the collection loading.

     

    System.InvalidCastException: Unable to cast object of type 'TelerikUI.TKCalendarMonthPresenter' to type 'UIKit.UIView'
    2015-10-23 14:51:37.757 BGNMobileAppiOS[3344:820123] Unhandled managed exception:
    Unable to cast object of type 'TelerikUI.TKCalendarMonthPresenter' to type 'UIKit.UIView' (System.InvalidCastException)
    at ObjCRuntime.Runtime.GetNSObject[UIView] (IntPtr ptr) [0x00000] in <filename unknown>:0
    at UIKit.UIView.get_Superview () [0x00010] in /Users/builder/data/lanes/2077/1d27ac2c/source/maccore/src/build/ios/native/UIKit/UIView.g.cs:3647
    at Xamarin.Forms.Platform.iOS.PageRenderer+<ViewAndSuperviewsOfView>d__22.MoveNext () [0x00035] in <filename unknown>:0
    at System.Linq.Enumerable.Any[UIView] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0
    at Xamarin.Forms.Platform.iOS.PageRenderer.OnShouldReceiveTouch (UIKit.UIGestureRecognizer recognizer, UIKit.UITouch touch) [0x0000c] in <filename unknown>:0
    at UIKit.UIGestureRecognizer+_UIGestureRecognizerDelegate.ShouldReceiveTouch (UIKit.UIGestureRecognizer recognizer, UIKit.UITouch touch) [0x0000d] in /Users/builder/data/la

  2. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 26 Oct 2015 Link to this post

    Hi Joe,

    This issue appears in one of our previous releases. The issue is addressed in the latest official release - Q3 2015 (2015.3.1016). Please, could you confirm that you are using this version? If yes, could you provide us with a sample project where we can reproduce the issue. Thank you in advance.

    Looking forward to your reply.

    Regards,
    Jack
    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
  4. Joe
    Joe avatar
    11 posts
    Member since:
    Jul 2015

    Posted 26 Oct 2015 in reply to Jack Link to this post

    I'm running version Q3 2015 (2015.3.1016).  I upgraded to that version to fix the calendar issue I reported on Android.   I don't really want to spend an hour setting up a demo to prove this.  This should be easy on your side to test.
  5. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 27 Oct 2015 Link to this post

    Hi Joe,

    We did several tests, however we are not able to reproduce this issue when using our latest release. Please, could you give us more information about the issue:

    1. Is the issue appearing on simulator or on device?
    2. What is the iOS and Xcode versions that you are using?
    3. What is the Xamarin version?

    Sending us a sample project or code snippet that we can use to reproduce this issue will help us to locate it faster and to find a proper solution. 

    Looking forward to your reply.

    Regards,
    Jack
    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
  6. Joe
    Joe avatar
    11 posts
    Member since:
    Jul 2015

    Posted 28 Oct 2015 Link to this post

    Telerik version: 2015.3.1016
    Xamarin Version: 1.5.0.6447

     

    Here's the code.  Just put in App.css and run

    using System;
    using Telerik.XamarinForms.Input;
    using Telerik.XamarinForms.Common;
    using Xamarin.Forms;
    namespace CalendarDemo
    {
    public class App : Application
    {
    public static MainPage _MasterDetailPage { get; set; }
    public static NavigationPage _NavPage { get; set; }
    public App()
    {
    _NavPage = new NavigationPage();
    // The root page of your application
    MainPage = new MainPage();
    }
    }
    public class MainPage : MasterDetailPage
    {
    ContentPage menuPage;
    public MainPage()
    {
    App._MasterDetailPage = this;
    menuPage = new ContentPage { Icon = "menu.png", Title = "Menu" };
    Master = menuPage;
    NavigateToPage((Page)Activator.CreateInstance(typeof(FirstPage)));
    }
    public async void NavigateToPage(Page targetPage = null)
    {
    if (targetPage != null)
    {
    await App._NavPage.PushAsync(targetPage);
    Detail = App._NavPage;
    IsPresented = false;
    }
    }
    }
    public class FirstPage : ContentPage
    {
    public FirstPage()
    {
    var layout = new StackLayout();
    var button = new Button
    {
    VerticalOptions = LayoutOptions.CenterAndExpand,
    HorizontalOptions = LayoutOptions.CenterAndExpand,
    Text = "Press for Calendar",
    };
    button.Clicked += Button_Clicked;
    layout.VerticalOptions = LayoutOptions.CenterAndExpand;
    layout.HorizontalOptions = LayoutOptions.CenterAndExpand;
    layout.Children.Add(button);
    Content = layout;
    }
    private void Button_Clicked(object sender, EventArgs e)
    {
    App._MasterDetailPage.NavigateToPage((Page)Activator.CreateInstance(typeof(CalendarPage)));
    }
    }
    public class CalendarPage : ContentPage
    {
    private static DateTime _DefaultDateTime = new DateTime(2000, 1, 1);
    public CalendarPage()
    {
    RadCalendar radCalendar = new RadCalendar();
    radCalendar.SelectedDate = _DefaultDateTime;
    radCalendar.SelectionChanged +=
    (object sender, ValueChangedEventArgs<object> e) =>
    {
    DateTime? selectedDate = e.NewValue as DateTime?;
    radCalendar.SelectedDate = _DefaultDateTime;
    App._MasterDetailPage.NavigateToPage((Page)Activator.CreateInstance(typeof(DateDetailPage), selectedDate));
    };
    Content = radCalendar;
    }
    }
    public class DateDetailPage : ContentPage
    {
    public DateDetailPage(DateTime? dateTime)
    {
    Content = new StackLayout
    {
    VerticalOptions = LayoutOptions.Center,
    Children = {
    new Label {
    XAlign = TextAlignment.Center,
    Text = "Welcome to DateDetailPage!!!"
    }
    }
    };
    }
    }
    }

  7. Jack
    Admin
    Jack avatar
    2333 posts

    Posted 29 Oct 2015 Link to this post

    Hi Joe,

    Thank you for sending those details. 

    I confirm the issue now. I logged it on our feedback portal and the issue will be addressed in our upcoming release in the beginning of November. You can use this link to track the issue status. I hope the time frame is OK for you. I updated also your Telerik points for bringing our attention to the issue.

    Do not hesitate to contact us if you have other questions.

    Regards,
    Jack
    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
  8. Joe
    Joe avatar
    11 posts
    Member since:
    Jul 2015

    Posted 13 Nov 2015 Link to this post

    When will the new release come out that will have this fix in it?  I'm ready to deploy my app and this is the only thing holding it up.

     

    Joe

     

  9. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 16 Nov 2015 Link to this post

    Hello Joe,

    The upcoming UI for Xamarin release is due in the middle of the next week. You can subscribe to the Release History RSS which will pop with right after the new release is out.

    Regards,
    Nikolay
    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
  10. Nikolay
    Admin
    Nikolay avatar
    1804 posts

    Posted 26 Nov 2015 Link to this post

    Hello Joe,

    I am glad to inform you that we have just released the new version of UI for Xamarin where your case is addressed. The new version works with Xamarin.Forms 2.0.0. Release Notes will follow shortly. Feel free to download the bits from your account.

    Regards,
    Nikolay
    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
Back to Top
DevCraft banner