TableViewCell's items are null

Hi, I try to add tableviewcell to a table, but the elements of cell are null. So I can’t set data for elements.

Anyone can help?



You can check out our RssReader sample for an example on how to use TableViewCells.

If you need more help, please post the relevant part of your code here so we can take a look.

Best Regards,

In my project I use tableView in a UIViewController so the sample not working.

Dear Máté Illés,

the difference between a UITableViewController and a UIViewController with a UITableView inside it is basically, that the UITableViewController sets itself as datasource and delegate for its own UITableView. You need to set these manually.

However this is most likely not your current issue. You say the “cells are null”. What are you using to retrieve the cells?
Take a look at Apple’s documentation: Creating Table View Cells.

If this did not solve your issue, please PM us a project where we can reproduce this issue.


I tried, what you suggest to me. It is not working.

https://[email protected]/mateilles718/rssreader.git this project. I think you have permission to see this.

I try to add cell at MyViewController (from row 144)


Dear Máté Illés,

even null after initWithStyleReuseIdentifier? Try to register a class for reuse identifier before using the table view:

    new, "<reuse ID>");

The initWithStyleReuseIdentifier line should not be necessary at all, dequeueReusableCellWithIdentifier takes care of initialization.


I did this:

new, “RssFeedCell”);

    UITableViewDataSource uiTableViewDataSource = new UITableViewDataSource() {
        public UITableViewCell tableViewCellForRowAtIndexPath(UITableView uiTableView, NSIndexPath nsIndexPath) {

            String simpleTableIdentifier = "RssFeedCell";

            RssFeedViewCell cell = (RssFeedViewCell) uiTableView.dequeueReusableCellWithIdentifier(simpleTableIdentifier);

            cell.title().setText(filteredLisFeed.get((int) nsIndexPath.row()).title);
            cell.detail().setText(filteredLisFeed.get((int) nsIndexPath.row()).description);


            //set color

            return cell;

and now I get this error:
2016-10-12 15:50:31.234 ios[73666:3422282] -[ title]: unrecognized selector sent to instance 0x7b214200 -[ title]: unrecognized selector sent to instance 0x7b214200
at ios.uikit.c.UIKit.UIApplicationMain(Native Method)

Dear Máté Illés,

I can’t see this class (RssFeedViewCell) in your repo, does it extend from UITableViewCell? Do you have @RegisterOnStartup annotation on that class?

Also, do you implement the alloc method?

public static native RssFeedViewCell alloc();

Sorry I forgot to tell, it is at addCustomCell branch

Dear Máté Illés,

try putting the @RegisterOnStartup annotation on the RssFeedViewCell class.

After I modified, I get this:

java.lang.NullPointerException: Attempt to invoke virtual method ‘void ios.uikit.UITextView.setText(java.lang.String)’ on a null object reference
at ios.uikit.c.UIKit.UIApplicationMain(Native Method)