0

I am getting a crash on navigating to one of the view controllers when using Hockey SDK in Xamarin iOS. This is the exception which I am receiving from hockey crash log:

*** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:usingPresentationValues:]: section (0) beyond bounds (0).'

I assume that this crash is happening because I am trying to scroll the tableview to a specified index before it is loaded completely. However the crash is not happening when I remove the Hockey SDK and run the app. It is working perfectly fine. Not sure why it happens only when Hockey SDK is used.

Please let me know why this is happening. Can I do something to resolve this ?.

public override void ViewWillAppear(bool animated)
    {
        try
        {
            NSIndexPath index = NSIndexPath.FromRowSection(0,0);
            taskListTableView.ScrollToRow(index,UITableViewScrollPosition.Top,true);
        }
        catch (Exception ex)
        {
            //Log exception
        }
    }  
subin272
  • 733
  • 6
  • 24
  • where did you add the tableview? in ViewDidLoad? – Lucas Zhang Aug 24 '18 at 09:55
  • I am adding the tableview in Storyboard, but I am registering the "Section" header view in ViewDidLoad. taskListTableView.RegisterNibForHeaderFooterViewReuse(UINib.FromName("SectionHeaderView", NSBundle.MainBundle), "SectionHeaderView"); – subin272 Aug 24 '18 at 18:09

0 Answers0