开发者

setting a view's tableView as a different view's IBOutlet

I am attempting to make an iPad app. I started out using the splitViewController app template, and realized that was a bit restrictive, so I've started moving everything over to a regular View-based app template. However, I'd still like to have a table on the left with a different view on the right. I have a NIB with a tableView on the left and a view on the right. The tableView i开发者_StackOverflow中文版s still in a separate class. Is there a way to load that view into the tableView of the NIB?

I'm trying code that looks like this:

rootViewController = [rootViewController initWithShow:assetOneID];
[rootViewController.tableView reloadData];
[htmlPage viewDidLoad];
htmlPage.myContent = rootViewController.tableView;
[htmlPage.myContent reloadData];

htmlPage is the main page with the table and the other view. myContent is its table. rootViewController is the class that I used for the table of items. When I try to run this(and I know there are items in rootViewController's table through using NSLog), nothing happens. The table just stays blank, even though it should have the title of the item in rootViewController.

I'm probably missing something obvious here, but I've tried many different things and none of them have worked. Thanks in advance for any help.


Delegation sounds like a solution but, regarding the blank tableview - Have you set the delegate and data source for the tablview in IB or programmatically?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜