public static SessionCell LoadFromNib() { // this bizarre loading sequence is modified from a blog post on AlexYork.net // basically we create an empty cell in C#, then pass that through a NIB loading, which then magically // gives us a new cell back in MonoTouch again var cell = new SessionCell("{}"); var views = NSBundle.MainBundle.LoadNib("SessionCell", cell, null); var cell2 = Runtime.GetNSObject( views.ValueAt(0) ) as SessionCell; cell.Initialise(); return cell; }
public static SessionCell LoadFromNib() { // this bizarre loading sequence is modified from a blog post on AlexYork.net // basically we create an empty cell in C#, then pass that through a NIB loading, which then magically // gives us a new cell back in MonoTouch again var cell = new SessionCell("{}"); var views = NSBundle.MainBundle.LoadNib("SessionCell", cell, null); var cell2 = Runtime.GetNSObject(views.ValueAt(0)) as SessionCell; cell.Initialise(); return(cell); }