views:

67

answers:

0

I am using navigation based approach. In RootViewController, I got a detailViewController. I want to control detailViewController from RootViewController. I tried Something like that.

in RootViewController.h

@interface RootViewController : UITableViewController{

PlayerListView *detailViewController;

}

in RootViewController.m

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

detailViewController = [[PlayerListView alloc] initWithNibName:@"PLayerListView" bundle:nil];
         // ...
         // Pass the selected object to the new view controller.
         [self.navigationController pushViewController:detailViewController animated:YES];
         [detailViewController release];

}

The problem is I cant use it like that in RootViewController.

[detailViewController TestMethod];

why I am trying to do is I got a toolbar that is controlled from RootViewController so I want use that toolbar to manage detailViewController content.

Thank you.