Forum Xamarin.Forms


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

NullReferenceException with CustomRenderer in iPhone 4, iOS 7.1.2

The crash exception has:

System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.iOS.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement view) [0x00000] in :0 at Xamarin.Forms.Platform.iOS.ListViewRenderer+UnevenListViewDataSource.GetHeightForRow (UIKit.UITableView tableView, Foundation.NSIndexPath indexPath) [0x00000] in :0 at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr) at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00000] in :0 at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in :0 at TVD.iOS.Application.Main (System.String[] args) [0x00000] in :0

We have:

<ListView.ItemTemplate> <DataTemplate> <custom:ListItemView /> </DataTemplate> </ListView.ItemTemplate>

public class ListItemView : ViewCell

[assembly: ExportRenderer(typeof(ListItemView), typeof(ListItemViewCellRenderer))] . . . public class ListItemViewCellRenderer : ViewCellRenderer

Is iPhone 4 a special case?


Sign In or Register to comment.