Skip to content

Instantly share code, notes, and snippets.

@epologee
Created January 13, 2011 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epologee/778758 to your computer and use it in GitHub Desktop.
Save epologee/778758 to your computer and use it in GitHub Desktop.
- (void)viewDidLoad
{
[super viewDidLoad];
self.title = @"Home";
self.tableView.rowHeight = 57.0;
tableViewData = [[NSArray arrayWithObjects:
[NSDictionary dictionaryWithObjectsAndKeys:@"Instagram", @"title", @"InstagramViewController", @"class", @"Icon.png", @"image", nil],
[NSDictionary dictionaryWithObjectsAndKeys:@"Path™", @"title", @"PathViewController", @"class", @"app-icon-114.png", @"image", nil],
[NSDictionary dictionaryWithObjectsAndKeys:@"DailyBooth", @"title", @"DailyBoothViewController", @"class", @"DailyBoothIcon.png", @"image",nil], nil] retain];
}
...
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString* class = [[tableViewData objectAtIndex:indexPath.row] objectForKey:@"class"];
Class detailClass = NSClassFromString(class);
UIViewController* detailViewController = [[[detailClass alloc] initWithNibName:nil bundle:nil] autorelease];
detailViewController.title = [[tableViewData objectAtIndex:indexPath.row] objectForKey:@"title"];
[self.navigationController pushViewController:detailViewController animated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment