試圖瞭解mvvmcross和廈門國際銀行的編輯 - 我按照示例代碼從mvvmcross數據綁定幫助需要
http://slodge.blogspot.co.uk/2013/01/uitableviewcell-using-xib-editor.html
並結合我的一些代碼中。
namespace ConX.UI.Touch.Cells
{
[Register("JobCell")]
public partial class JobCell : MvxBaseBindableTableViewCell
{
public static NSString Identifier = new NSString("JobCell");
public const string BindingText = @"{'JobDescription':{'Path':'Description'}, 'JobScheduledForDate':{'Path':'ScheduledForDate'}, 'JobNumber':{'Path':'JobNo'}}";
public JobCell(): base(BindingText)
{
}
public JobCell(IntPtr handle): base(BindingText, handle)
{
}
public JobCell (string bindingText): base(bindingText, UITableViewCellStyle.Default, Identifier)
{
}
public string JobDescription
{
get { return this.DescriptionLabel.Text; }
set { this.DescriptionLabel.Text = value; }
}
public string JobScheduledForDate
{
get { return ScheduledForDateLabel.Text; }
set { ScheduledForDateLabel.Text = value; }
}
public string JobNumber
{
get { return NumberLabel.Text; }
set { NumberLabel.Text = value; }
}
}
}
using MonoTouch.Foundation;
namespace ConX.UI.Touch.Cells
{
partial class JobCell
{
[Outlet]
MonoTouch.UIKit.UILabel DescriptionLabel { get; set; }
[Outlet]
MonoTouch.UIKit.UILabel ScheduledForDateLabel { get; set; }
[Outlet]
MonoTouch.UIKit.UILabel NumberLabel { get; set; }
void ReleaseDesignerOutlets()
{
if (DescriptionLabel != null) {
DescriptionLabel.Dispose();
DescriptionLabel = null;
}
if (ScheduledForDateLabel != null) {
ScheduledForDateLabel.Dispose();
ScheduledForDateLabel = null;
}
if (NumberLabel != null) {
NumberLabel.Dispose();
NumberLabel = null;
}
}
}
}
我只是不能與拋出下面的錯誤這項工作 - 似乎網點沒有被創造出來的?
System.NullReferenceException: Object reference not set to an instance of an object
at ConX.UI.Touch.Cells.JobCell.set_JobDescription (System.String value) [0x00008] in
/Volumes/ConXPrototype/Conx.UI.Touch/Cells/JobCell.cs:32
at
ConX.UI.Touch.Views.BaseJobListView`2+TableSource[ConX.Core.ViewModels.JobListViewModel,Syst
em.DateTime].GetOrCreateCellFor (MonoTouch.UIKit.UITableView tableView,
MonoTouch.Foundation.NSIndexPath indexPath, System.Object item) [0x00025] in
/Volumes/ConXPrototype/Conx.UI.Touch/Views/BaseJobListView.cs:101
at Cirrious.MvvmCross.Binding.Touch.Views.MvxBaseBindableTableViewSource.GetCell
(MonoTouch.UIKit.UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
[0x00000] in <filenam
非常感謝 克恩
二進制文件已更新,切換到RegisterNibForCellReuse()客場笑。 謝謝Stuart - 真棒框架。 – Kern