0

I want to be able to switch between views. I have been writing some code, but it is not working?

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath;
{
    AlleRumViewController *allerum = [[AlleRumViewController alloc] initWithNibName:nil bundle:nil];

    if ([[tableData objectAtIndex:indexPath.row] isEqual:@"Alle rum"]) {    
        [self presentModalViewController:allerum animated:YES];
    }
}

Do any of you know how i can switch?

Larme
  • 24,190
  • 6
  • 51
  • 81
Mikkel V.
  • 155
  • 1
  • 3
  • 11

1 Answers1

0
- (IBAction)goButtonPressed:(UIButton*) source {
YourNewViewController* someNameController = [[YourNewViewController alloc] init];
[self.navigationController pushViewController:someNameController animated:YES];
[someNameController release];
}
Denes
  • 26
  • 1
  • 5
  • Of course in the case of TableViewController you can write this code to the didSelectRowAtIndexPath method. – Denes May 20 '12 at 11:54