Bug 5314 - MonoTouch.Dialog.StyledStringElement throws if cell has no imageview
Summary: MonoTouch.Dialog.StyledStringElement throws if cell has no imageview
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-05-24 20:16 UTC by Felix Collins
Modified: 2012-05-29 08:44 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Felix Collins 2012-05-24 20:16:55 UTC
Code from my DialogViewController

var element = new StyledMultilineElement(string.Empty, "test", UITableViewCellStyle.Value2){BackgroundColor = UIColor.Clear,};

Root = new RootElement(Localized.VisionsLiveBB)
{new Section(){element}};

Exception stacktrace:

[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at MonoTouch.Dialog.StyledStringElement.PrepareCell (MonoTouch.UIKit.UITableViewCell cell) [0x00117] in /Developer/MonoTouch/Source/MonoTouch.Dialog/MonoTouch.Dialog/Elements.cs:844 
  at MonoTouch.Dialog.StyledStringElement.GetCell (MonoTouch.UIKit.UITableView tv) [0x0002f] in /Developer/MonoTouch/Source/MonoTouch.Dialog/MonoTouch.Dialog/Elements.cs:813 
  at MonoTouch.Dialog.DialogViewController+Source.GetCell (MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath) [0x00029] in /Developer/MonoTouch/Source/MonoTouch.Dialog/MonoTouch.Dialog/DialogViewController.cs:340 
  at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00042] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:29 
  at Touch.Container.Application.Main (System.String[] args) [0x00000] in /Users/felix/VLM/source/MobileBullet/Touch.Container/Main.cs:26
Comment 1 Rolf Bjarne Kvinge [MSFT] 2012-05-29 08:44:47 UTC
Fixed in monotouch master (f5f2da7e346987eeb17e5aab2fc9bc41b9ce5e3c).