Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

added missing iOS constructor in ListViewRenderer #14971

Conversation

narciszait
Copy link
Contributor

@narciszait narciszait commented Dec 9, 2021

Description of Change

Added a missing constructor in ListViewRenderer

Issues Resolved

Could not find it. But I saw it in the app crash logs:

ObjCRuntime.RuntimeException

Failed to marshal the Objective-C object 0x28382b600 (type: Xamarin_Forms_Platform_iOS_ListViewRenderer_ListViewDataSource). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Xamarin.Forms.Platform.iOS.ListViewRenderer+ListViewDataSource' does not have a constructor that takes one IntPtr argument).

API Changes

Added:

  • public ListViewRenderer(IntPtr handle)

Platforms Affected

  • iOS

Behavioral/Visual Changes

By having that missing constructor, we avoid that exception

Testing Procedure

I saw it in our crash logs.
Don't know necessarily how to reproduce it.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@jsuarezruiz jsuarezruiz added a/listview Problems with the ListView/TableView t/bug 🐛 p/iOS 🍎 labels Dec 9, 2021
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you share a more detailed logs to try to know when this happens?. Thanks for the PR and the feedback.

@narciszait
Copy link
Contributor Author

this is the whole stack trace that i can see in our crash logs:

ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x282dcf7c0 (type: Xamarin_Forms_Platform_iOS_ListViewRenderer_ListViewDataSource). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'Xamarin.Forms.Platform.iOS.ListViewRenderer+ListViewDataSource' does not have a constructor that takes one IntPtr argument).
?, in void Runtime.MissingCtor(IntPtr ptr, IntPtr klass, Type type, MissingCtorResolution resolution)
?, in NSObject Runtime.ConstructNSObject(IntPtr ptr, Type type, MissingCtorResolution missingCtorResolution)
?, in NSObject Runtime.ConstructNSObject(IntPtr ptr, IntPtr klass, MissingCtorResolution missingCtorResolution)
?, in NSObject Runtime.GetNSObject(IntPtr ptr, MissingCtorResolution missingCtorResolution, bool evenInFinalizerQueue) x 2
?, in NSObject UITableView.get_WeakDelegate()
?, in UITableViewSource UITableView.get_Source()
?, in void FormsUITableViewController.ViewWillLayoutSubviews()
?, in void UIApplication.Main(string[] args, Type principalClass, Type delegateClass)
?, in void Application.Main(string[] args)

@jfversluis
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it will fix the issue but I guess it doesn't hurt as well :)

@jfversluis jfversluis merged commit bd7d8eb into xamarin:5.0.0 Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/listview Problems with the ListView/TableView p/iOS 🍎 t/bug 🐛
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants