Loading UITableView form UIView

Posted by Amarpreet on Stack Overflow See other posts from Stack Overflow or by Amarpreet
Published on 2010-06-02T06:59:39Z Indexed on 2010/06/02 7:03 UTC
Read the original article Hit count: 365

Filed under:
|

Hi Guys,

I am working on navigation based application in which i can navigate to many views starting from default UITableView which is starting view in application template.

I have added another UIView and added tableView control on that UIView.

I am calling that view form one of the many views on a button click. Its showing the view but not populating the data in the table. And I also want to handle the event when user taps on the cell of the table of that view. Below is the Code I am using on button click:

if(self.lstView == nil)

{

ListViewController *viewController = [[ListViewController alloc] initWithNibName:@"ListViewController" bundle:nil];

    self.lstView = viewController;

    [viewController release];

}

[self.navigationController pushViewController:lstView animated:YES];

self.lstView.title = @"Select";//@"System";

[self.lstView.tblList.dataSource fillList];

Below is the fillList function code:

-(NSArray *)fillList

{

NSArray *tempArray = [[[NSArray alloc] initWithObjects:@"Item 1" , @"Item 2" , nil]autorelease];

return tempArray;

}

I am pretty new in Iphone programming and don't have much understanding.

Helping with detailed description and code will be highly appreciated.

Thanks.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview