views:

38

answers:

1

So i have a:

arrangeList = [[UITableView alloc] initWithFrame:CGRectMake(attributesPadding, y, popoverWidth - 2* attributesPadding, popoverHeight - y - attributesPadding) 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

A: 

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.

Andrew Little
Thank you good sir. Unfortunately IB wont let me do some of the things i would like.
Kyle Martin
So hey, now when i click something in my list, it isnt triggering my - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {method, do i need to set the delegate somehow too?
Kyle Martin
interesting. the table fills with data, but the row selection isn't triggered? I would expect that if the cells are being populated then that proves the table view is correctly wired up. I might need to see some code.
Andrew Little