I´m making an app which has 2 navigation controllers. One has a tableView, and when a tap in the cells, I want to load the other viewController, but I always have this error:
fifthvieController may no respond to -navigationController2
Here's the code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *letraSeleccionada = [lista objectAtIndex:indexPath.row];
FourthViewController *fourth = [[FourthViewController alloc]initWithNibName:@"FourthViewController" bundle:nil];
fourth.letraSeleccionada = letraSeleccionada;
[[self navigationController2] pushViewController:fourth animated:YES]; //here
[fourth release];
fourth = nil;
}
i have changed the code an now it works but I don´t understand why before it doesn´t work. Here the new code:
PruebaPushAppDelegate *delegate = [[UIApplication sharedApplication]delegate];
[delegate.navigationController2 pushViewController:fourth animated:YES];
//[[self navigationController2] pushViewController:fourth animated:YES];