2011-08-24 54 views
0

我有以下设置。我有一个带有三个NavigationControllers的TabBarController。我想要做的是以下几点:Tabbar控制器通过应用程序代理访问当前选项卡的活动导航控制器

我有一个带有注释的mapview和一个注释按钮,我实现了当注释按钮被点击时触发的委托方法。我的问题是,我的MapView的委托也是MapView的

[self.mapView addSubview:self]; 
[self.mapView setRegion:region]; 
[self.mapView setDelegate:self]; 

这是我用来吸取我的MapView的路线的自定义类的子视图。

换言之下面的方法是在自定义类,这是我的MapView类的

- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control 
{ 
    Helper *myHelper = [Helper sharedManager]; 
    StationInfo *myViewController = [[StationInfo alloc] initWithNibName:@"StationInfo" bundle:[NSBundle mainBundle]]; 
    myViewController.station = [myHelper.stations objectAtIndex:[myHelper.stations indexOfObject:[view annotation]]]; 
    GautrainiPhoneAppDelegate *del = (GautrainiPhoneAppDelegate *)[UIApplication sharedApplication].delegate; 
    //missing code to push the controller onto the navigation controller that is on the active tab in the tabBarcontroller 

} 

那么,如何可以推视图控制器到有源标签的导航堆栈使用应用程序委托的委托,它包含我的tabbarcontroller

回答

0

找到了我想要做的可行解决方案。我为我试图访问的导航控制器创建了一个插座,然后只是推动我的视图

相关问题