dormitkon
dormitkon

Reputation: 2526

Simple ios app example (UITabbarController, UITableView)

I made app with three tab bars (thought IB) and it works. But, in one view I need table view and when I click on row, to get detailes about this row.

There is some project example how to do this programmatically without using Interface builder?

Upvotes: 0

Views: 992

Answers (2)

EFC
EFC

Reputation: 1949

Check out the material for the Stanford iPhone programming classes. They have some great TableView sections that include samples for building these in code. See the course website.

Upvotes: 1

0x90
0x90

Reputation: 6259

To create an UITableView programmatically:

UITableView *myTable = [[UITableView alloc] initWithFrame:CGRectMake(0,0,320,420)];
myTable.dataSource = self;
myTable.delegate = self;

Then implement the UITableViewDelegate and UITableViewDataSource methods as you would have done when using InterfaceBuilder.

For selecting the row create the delegate function

– tableView:willSelectRowAtIndexPath:

and push a new UIView onto the nagivationController. Alternatively (if you don't use a navigationController), you can also present the new view as a modalViewController.

Upvotes: 1

Related Questions