I'm missing something I suspect is obvious but I can't find it.
UITableViewCell cell = tableView.DequeueReusableCell("MyCell");
if (cell == null) {
cell = new UITableViewCell(UITableViewCellStyle.Default, "MyCell");
}
cell.TextLabel.Text = "Foo";
cell.DetailTextLabel.Text = "Foo2";
I'm getting a null reference exception with the DetailTextLabel
.
It's because you are using UITableViewCellStyle.Default. You need UITableViewCellStyle.Subtitle if you want the detailsLabel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With