Created
January 13, 2011 22:36
-
-
Save epologee/778758 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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