Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Custom UITableViewCell - UILabel is null

$
0
0

Hi,

I'm using the Xamarin Studio Designer. I have a custom UITableViewCell class which has 3 UILabels in the designer. I can see the outlets for these in the .Designer.cs and access them within the class itself.

My GetCell routine creates a new cell and tries to set the names. I couldn't access the UILabels from here so I created a property in the custom class for each one which I set here. However when I set the property which sets UILabel.Text; the UILabel is null.

Do you have any idea where I might be going wrong?

` public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) {

        string cellIdentifier = "Cell";
        cellMatter cell = (cellMatter)tableView.DequeueReusableCell (cellIdentifier);
        if (cell == null) {
            cell = new cellMatter (); // (UITableViewCellStyle.Default, cellIdentifier);
            cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
        };

        cell.Init ();
        cell.ClientName = rows [indexPath.Row].ShortName;
        cell.MatterDesc = rows [indexPath.Row].FullDesc;
        cell.AccountRef = rows [indexPath.Row].AccountRef;
        cell.SetNeedsLayout();
        return cell;
    } `

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>