PDA

View Full Version : UITableView




drf1229
Jun 24, 2009, 07:56 PM
Hello, I made a basic app with a few different views. I thought it would look cool if I made the main menu a table, but I don't know how to handle when the user clicks different cells the table and I don't know how to name the elements of the table. Any help would be appreciated!



lildragon
Jun 24, 2009, 08:28 PM
I just got through this process. I can recommend a few things

http://vimeo.com/album/97812 and what you're looking for there is Using Tables with Navigation Bars and Tabs - Part 1 and 2 but the others are great as well.

Once you get through that, and understand what is being done, pick apart UICatalog (http://developer.apple.com/iphone/library/samplecode/UICatalog/index.html) from Apple. Pay attention especially to this block of code in the MainViewController.m

// for showing various UIControls:
ControlsViewController *controlsViewController = [[ControlsViewController alloc]
initWithNibName:@"ControlsViewController" bundle:nil];
[self.menuList addObject:[NSDictionary dictionaryWithObjectsAndKeys:
NSLocalizedString(@"ControlsTitle", @""), kTitleKey,
controlsViewController, kViewControllerKey,
nil]];
[controlsViewController release];

Pick it apart.

Good luck!

drf1229
Jun 24, 2009, 08:32 PM
Thank you so much!