views:

29

answers:

1

Hi, I'm working on an app which has a main menu which then switches views based on the menu item clicked using a UINavigationController. Whenever I run my app and click on an item in the menu, it is a good five seconds before the view loads. Is this normal or do I need to do this in another way. Thanks for looking!

My code in RootViewController.m looks like this.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *selectedMenuOption = [menuOptions objectAtIndex:indexPath.row];
if (selectedMenuOption == @"Trails") {
    TrailsViewController *trailsViewController = [[TrailsViewController alloc] initWithNibName:@"TrailsViewController" bundle:[NSBundle mainBundle]];
    trailsViewController.selectedMenuOption = selectedMenuOption;
    [self.navigationController pushViewController:trailsViewController animated:YES];
    [trailsViewController release];
}
if (selectedMenuOption == @"Bike Shops") {
    ShopsViewController *shopsViewController = [[ShopsViewController alloc] initWithNibName:@"ShopsViewController" bundle:[NSBundle mainBundle]];
    shopsViewController.selectedMenuOption = selectedMenuOption;
    [self.navigationController pushViewController:shopsViewController animated:YES];
    [shopsViewController release];
}}
A: 

I sorted it out. I forgot to set the number of rows and such in the next views.

enbr