Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6561119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:32:54+00:00 2026-05-25T13:32:54+00:00

I’m building an app that contains an UITableview. I got tableview to work perfectly

  • 0

I’m building an app that contains an UITableview. I got tableview to work perfectly now I want to make the cells more specific to my needs. The tableviewcell contains a picture a title, subititle and a releasedate. I thought this was simple to do but i cannot get it to work. I try to follow the example (and the sample) out of wrox Professional iPhone programming monotouch ( pages: 120 and 121) but I cannot get it to work in my case. I tried following this link and this link too, but to no avail.
The second i do one thing differently it becomes a problem.

I have some of the following files in my project:

  • RootViewController (UITableViewController)
  • myTableViewCell (UITableViewCell)
  • BasicTableViewSource ( UITableViewSource)

Note: I already had a RootViewController but when I was creating the interface for the cell i’ve added a partial (for RootViewController) to add the cell into.

Here is my code snippets:

myTableViewCell.xib.designer.cs

// Base type probably should be MonoTouch.UIKit.UIViewController or subclass
[MonoTouch.Foundation.Register("RootViewController")]
public partial class RootViewController {

    private myTableViewCell __mt_Cell;

    #pragma warning disable 0169
    [MonoTouch.Foundation.Connect("Cell")]
    private myTableViewCell Cell {
        get {
            this.__mt_Cell = ((myTableViewCell)(this.GetNativeField("Cell")));
            return this.__mt_Cell;
        }
        set {
            this.__mt_Cell = value;
            this.SetNativeField("Cell", value);
        }
    }
}

// Base type probably should be MonoTouch.UIKit.UITableViewCell or subclass
[MonoTouch.Foundation.Register("myTableViewCell")]
public partial class myTableViewCell {

    private MonoTouch.UIKit.UIImageView __mt_img;

    private MonoTouch.UIKit.UILabel __mt_lblInfo;

    private MonoTouch.UIKit.UILabel __mt_lblReleaseDate;

    private MonoTouch.UIKit.UILabel __mt_lblTitle;

    #pragma warning disable 0169
    [MonoTouch.Foundation.Connect("img")]
    private MonoTouch.UIKit.UIImageView img {
        get {
            this.__mt_img = ((MonoTouch.UIKit.UIImageView)(this.GetNativeField("img")));
            return this.__mt_img;
        }
        set {
            this.__mt_img = value;
            this.SetNativeField("img", value);
        }
    }

    [MonoTouch.Foundation.Connect("lblInfo")]
    private MonoTouch.UIKit.UILabel lblInfo {
        get {
            this.__mt_lblInfo = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblInfo")));
            return this.__mt_lblInfo;
        }
        set {
            this.__mt_lblInfo = value;
            this.SetNativeField("lblInfo", value);
        }
    }

    [MonoTouch.Foundation.Connect("lblReleaseDate")]
    private MonoTouch.UIKit.UILabel lblReleaseDate {
        get {
            this.__mt_lblReleaseDate = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblReleaseDate")));
            return this.__mt_lblReleaseDate;
        }
        set {
            this.__mt_lblReleaseDate = value;
            this.SetNativeField("lblReleaseDate", value);
        }
    }

    [MonoTouch.Foundation.Connect("lblTitle")]
    private MonoTouch.UIKit.UILabel lblTitle {
        get {
            this.__mt_lblTitle = ((MonoTouch.UIKit.UILabel)(this.GetNativeField("lblTitle")));
            return this.__mt_lblTitle;
        }
        set {
            this.__mt_lblTitle = value;
            this.SetNativeField("lblTitle", value);
        }
    }

BasicTableVIiewSource.cs

        public override UITableViewCell GetCell(UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
    {
        UITableViewCell cell = tableView.DequeueReusableCell(this._cellIdentifier);

        myTableViewCell mycell = null;
        //if (cell == null)
        //{
            mycell = new myTableViewCell();
            //NSBundle.MainBundle.LoadNib("RootViewController", _controller, null);
            //_controller.myTableCell = new myTableViewCell();
            //mycell = _controller.myTableCell;
            //cell = new UITableViewCell(UITableViewCellStyle.Subtitle, this._cellIdentifier);
        //}
        //else
        //{
        //  mycell = (myTableViewCell)cell;
        //}


                TrailerInfo item = this._tableItems[indexPath.Section].items[indexPath.Row];

                mycell.Title = item.Title;
                mycell.Info = "Genre: " + item.genre ;  
                mycell.ReleaseDate = Convert.ToDateTime(item.Releasedate).ToLongDateString();
                mycell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
                if(!string.IsNullOrEmpty(item.ImageURL))
                {
                    mycell.myImage = item.image;

                }

    return mycell;

}

RootViewController.xib.designer.cs

// Base type probably should be MonoTouch.UIKit.UIViewController or subclass
//[MonoTouch.Foundation.Register("RootViewController")]
public partial class RootViewController {

    private MonoTouch.UIKit.UITableView __mt_view;

    #pragma warning disable 0169
    [MonoTouch.Foundation.Connect("view")]
    private MonoTouch.UIKit.UITableView view {
        get {
            this.__mt_view = ((MonoTouch.UIKit.UITableView)(this.GetNativeField("view")));
            return this.__mt_view;
        }
        set {
            this.__mt_view = value;
            this.SetNativeField("view", value);
        }
    }
}

RootViewController.xib

        public override void ViewDidAppear(bool some)
    {
        this.TableView.Source = new BasicTableViewSource(items, this);
    }

As you can see through time i’ve been changing the code. I’m not sure what exactly is the problem. Lately it keeps telling me that the properties (title, info, releasedate) are null. So i’m assuming that mytableviewcell is not being initiated (or referenced). It feels like the two RootViewControlller partial classes are not working together. Again this is just a hunch i’m simply clueless to what is going wrong. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:32:54+00:00Added an answer on May 25, 2026 at 1:32 pm

    It is solved! I think it was some sort of typo. I diligently walked every line of code repeating all the steps from the Wrox book and it works now! So I think that I wrote a name wrong somewhere in IB.

    It wasn’t aggressive garbage collection after all. but thanks for the suggestion!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i want to parse a xhtml file and display in UITableView. what is the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.