It seems to me that you have a class called VerwaltungDetailViewController (note the uppercase "V"), and you mix it with the instance variable and the VerwaltungDetailViewController property (note the lowercase "v"). In the first line of the if block, you are trying to instantiate the latter, when you should try to instantiate the first. Your code should look something like this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = [indexPath row]; if (self.verwaltungDetailViewController == nil){ VerwaltungDetailViewController *aVerwaltungDetail = [[verwaltungDetailViewController alloc] initWithNibName:@"VerwaltungDetailView" bundle:nil]; self.verwaltungDetailViewController = aVerwaltungDetail; [aVerwaltungDetail release]; } verwaltungDetailViewController.title = [NSString stringWithFormat:@"%@", [verwaltungsArray objectAtIndex:row]]; NatersAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.verwaltungNavController pushViewController:verwaltungDetailViewController animated:YES];
Edit: You also make a mistake in the last line of code, except to the contrary.
Jim
source share