tags:

views:

45

answers:

3

Hi,

Can i create a table by using only a UITableView without a UITableViewController? Is it possible, if it so how to do that programatically?

A: 

I am not sure that I understand -- what is it that you actually want to achieve?

Konrad Neuwirth
I want to create a application with UITableView without using a Controller i.e. only with views. Can i achieve it?
suse
A: 

Yes you can:

UITableView *table = 
   [[UITableView alloc] initWithFrame:CGRectMake(x, y, width, height)
                        style:UITableViewStyleGrouped];

// Other initializations go here

[parent_view addSubview: table];
[table release];
Tuomas Pelkonen
Thanks this worked out for me..Now how should i add UITableViewCell to the UITableView?
suse
+1  A: 

It would be easier to answer your question if you could tell us what is the reason you want to use UITableView instead of UITableViewController?

I believe that you can use UITableView and not the UITableViewContoller, but in this case you need to set appropraite delegates (dataSource and delegate) which need to comply with appropriate protocols. For more information have a look at the documentation at: http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableView_Class/Reference/Reference.html#//apple_ref/occ/instp/UITableView/dataSource

Jakub