开发者

how do i connect a uitableview to a uitableviewcontroller programmatically?

开发者 https://www.devze.com 2023-01-14 16:17 出处:网络
So i have a: arrangeList = [[UITableView alloc] initWithFrame:CGRectMake(attributesPadding, y, popoverWidth - 2* attributesPadding, popoverHeight - y - attrib开发者_Go百科utesPadding) style:UITableVi

So i have a:

arrangeList = [[UITableView alloc] initWithFrame:CGRectMake(attributesPadding, y, popoverWidth - 2* attributesPadding, popoverHeight - y - attrib开发者_Go百科utesPadding) style:UITableViewStylePlain];

That is the tableview that i want to connect to a controller, and i also have added this tableview to a uiview that i have animate onto the screen in based on a click. So i subclassed uiviewcontroller and created this :

arrangeListViewController = [[[ArrangeListViewController alloc] init] autorelease];

Now how do i make it so that the 'arrangeList' is populated based on 'arrangeListViewController'?

Is this approach way wrong ? any help is welcome


I think you'll want to look at something like:

arrangeListViewController.tableView = arrangeList;
[arrangeList release]; //avoid leaking the arrangeList

Personally, I prefer setting this up in InterfaceBuilder, but it'll work programatically as well.

Hope this helps. Andrew.

0

精彩评论

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