Fixes {System.ObjectDisposedException: Cannot access a disposed object.Object name: 'UIKit.UICollectionView'.
It happens if you have the listview in a grid and you need to move the listview to another cell. If you rotate the device for example. Because myGrid.Children.Remove(listview) calls dispose on iOSHorizontalListViewRenderer. And when _collectionView != null no new instance is creating and app will crash at SetNativeControl(_collectionView).
Exception StackTrace:
at ObjCRuntime.ThrowHelper.ThrowObjectDisposedException (System.Object o) [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/ThrowHelper.cs:34
at ObjCRuntime.NativeObjectExtensions.GetNonNullHandle (ObjCRuntime.INativeObject self, System.String argumentName) [0x0001b] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/ObjCRuntime/INativeObject.cs:29
at UIKit.UIView.AddSubview (UIKit.UIView view) [0x00005] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/build/ios/native/UIKit/UIView.g.cs:240
at Xamarin.Forms.Platform.iOS.ViewRenderer`2[TView,TNativeView].SetNativeControl (TNativeView uiview) [0x00047] in D:\a\1\s\Xamarin.Forms.Platform.iOS\ViewRenderer.cs:240
at Sharpnado.HorizontalListView.iOS.Renderers.HorizontalList.iOSHorizontalListViewRenderer.SetCollectionView (UIKit.UICollectionView collectionView) [0x00000] in D:\Dev\Sharpnado\src\Sharpnado.HorizontalListView\Sharpnado.HorizontalListView.iOS\Renderers\HorizontalList\iOSHorizontalListViewRenderer.cs:215
at Sharpnado.HorizontalListView.iOS.Renderers.HorizontalList.iOSHorizontalListViewRenderer.LayoutSubviews () [0x00075] in D:\Dev\Sharpnado\src\Sharpnado.HorizontalListView\Sharpnado.HorizontalListView.iOS\Renderers\HorizontalList\iOSHorizontalListViewRenderer.cs:61
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:69
Fixes {System.ObjectDisposedException: Cannot access a disposed object.Object name: 'UIKit.UICollectionView'. It happens if you have the listview in a grid and you need to move the listview to another cell. If you rotate the device for example. Because myGrid.Children.Remove(listview) calls dispose on iOSHorizontalListViewRenderer. And when _collectionView != null no new instance is creating and app will crash at SetNativeControl(_collectionView).
Exception StackTrace: