Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

NavigateFromMenu System.NullReferenceException

$
0
0

Hi,
I used the MasterDetailPage Xamarin template and have been building on top of it for my application. In the method NavigateFromMenu when I set the Detail to a newPage, I get System.NullReferenceException. Sometimes it works when navigating away form the items page but when going back to the items page I get the error.
Building for iOS atm.

The code I'm using to change detail page:

Detail = new NavigationPage(new ItemsPage());

It is a bit inconsisted sometimes, whilst navigating between different pages like the About page works most of the time but sometimes gets the error also.

This is the stack trace:

System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].UpdateTabStop () [0x00007] in <fd2e4f760bbf4d6f990e6092620244bd>:0 at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Xamarin.Forms.Platform.iOS.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement element) [0x0000c] in <fd2e4f760bbf4d6f990e6092620244bd>:0 at Telerik.XamarinForms.Common.RadPlatform.RetireRenderer (Xamarin.Forms.VisualElement visualElement) [0x0001a] in <8351c2f0e45d4b95b1226b77e459069c>:0 at Telerik.XamarinForms.DataControlsRenderer.iOS.ListView.UIListViewTemplateCell.RetireXFViewAndView () [0x0001f] in <3afd37b4b5964b6eb8f977e96ff93853>:0 at Telerik.XamarinForms.DataControlsRenderer.iOS.ListView.UIListViewTemplateCell.Dispose (System.Boolean disposing) [0x00003] in <3afd37b4b5964b6eb8f977e96ff93853>:0 at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/Foundation/NSObject2.cs:147 at Telerik.XamarinForms.DataControlsRenderer.iOS.TKExtendedListView.DisposeCells () [0x0001a] in <3afd37b4b5964b6eb8f977e96ff93853>:0 at Telerik.XamarinForms.DataControlsRenderer.iOS.TKExtendedListView.Dispose (System.Boolean disposing) [0x0001f] in <3afd37b4b5964b6eb8f977e96ff93853>:0 at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/Foundation/NSObject2.cs:147 at Xamarin.Forms.Platform.iOS.ViewRenderer`2[TView,TNativeView].Dispose (System.Boolean disposing) [0x00035] in <fd2e4f760bbf4d6f990e6092620244bd>:0 at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/Foundation/NSObject2.cs:147 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:69 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:37 at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <fd2e4f760bbf4d6f990e6092620244bd>:0 at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/Foundation/NSObject2.cs:147 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:69 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:37 at Xamarin.Forms.Platform.iOS.VisualElementRenderer`1[TElement].Dispose (System.Boolean disposing) [0x00058] in <fd2e4f760bbf4d6f990e6092620244bd>:0 at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/Foundation/NSObject2.cs:147 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:69 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:37 at Xamarin.Forms.Platform.iOS.ScrollViewRenderer.Dispose (System.Boolean disposing) [0x00016] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\ScrollViewRenderer.cs:165 at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/Foundation/NSObject2.cs:147 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose (System.Boolean disposing) [0x0003f] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:69 at Xamarin.Forms.Platform.iOS.VisualElementPackager.Dispose () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.iOS\VisualElementPackager.cs:37 at Xamarin.Forms.Platform.iOS.PageRenderer.Dispose (System.Boolean disposing) [0x00070] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Renderers\PageRenderer.cs:164 at Foundation.NSObject.Dispose () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/Foundation/NSObject2.cs:147 at Xamarin.Forms.Platform.iOS.DisposeHelpers.DisposeModalAndChildRenderers (Xamarin.Forms.Element view) [0x00038] in D:\a\1\s\Xamarin.Forms.Platform.iOS\DisposeHelpers.cs:17 at Xamarin.Forms.Platform.iOS.Platform.HandleChildRemoved (System.Object sender, Xamarin.Forms.ElementEventArgs e) [0x00006] in D:\a\1\s\Xamarin.Forms.Platform.iOS\Platform.cs:297 at Xamarin.Forms.Element.OnDescendantRemoved (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:617 at Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element child) [0x0001f] in D:\a\1\s\Xamarin.Forms.Core\Element.cs:357 at Xamarin.Forms.VisualElement.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in D:\a\1\s\Xamarin.Forms.Core\VisualElement.cs:748 at Xamarin.Forms.Page.OnInternalRemoved (Xamarin.Forms.VisualElement view) [0x00013] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:380 at Xamarin.Forms.Page.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00022] in D:\a\1\s\Xamarin.Forms.Core\Page.cs:358 at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000f] in <8294fc839f2d4b799a08e766e2dfa68e>:0 at System.Collections.ObjectModel.ObservableCollection`1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedAction action, System.Object item, System.Int32 index) [0x00009] in <8294fc839f2d4b799a08e766e2dfa68e>:0 at System.Collections.ObjectModel.ObservableCollection`1[T].RemoveItem (System.Int32 index) [0x0002b] in <8294fc839f2d4b799a08e766e2dfa68e>:0 at System.Collections.ObjectModel.Collection`1[T].Remove (T item) [0x00027] in <3c7b99a36820490fb2cbc5a6fc6b06d8>:0 at Xamarin.Forms.MasterDetailPage.set_Detail (Xamarin.Forms.Page value) [0x0004b] in D:\a\1\s\Xamarin.Forms.Core\MasterDetailPage.cs:44 at XamarinPlaypen.Views.MainPage+<NavigateFromMenu>d__6.MoveNext () [0x00112] in C:\Repos\DeveloperReference\XamarinPlaypen\XamarinPlaypen\XamarinPlaypen\Views\MainPage.xaml.cs:59


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>