sathya
sathya

Reputation: 384

how to view a tableview controller when a button is clicked in iphone

While clicking a Button i need to view a table view container in next window. I tried it by story board connecting the button with file owner and viewed the table but i need to do it as program. I was thinking to give some event handlers to button and view the table. Is it possible to do so. I attached the image for reference,

From button to Table view I used this code,

TableViewController *yourTableViewController = [[TableViewController alloc] initWithNibName:@"TableViewController" bundle:nil];
self.navigationController pushViewController:yourTableViewController animated:YES];

in the " viewDidLoad() " but it doesn't shown. Do i need to configure any in storyboard to do it. Kindly suggest me.

Upvotes: 1

Views: 365

Answers (1)

lakshmen
lakshmen

Reputation: 29064

put in the button that u are clicking instead of the viewdidload.

watch this: mobile.tutsplus.com/tutorials/iphone/uitableview

Upvotes: 2

Related Questions