我的错误如下:
在 ViewList 中,我有下面的代码,它确实推动了 ViewManager;
- (Void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
{
PropertyManagerViewController propertyManagerViewController * = [[PropertyManagerViewController alloc] initWithNibName: @ "PropertyManagerViewController" bundle: nil];
[self.navigationController pushViewController: propertyManagerViewController animated: YES];
}
在 ViewManager 中创建 UITabBarController :
- (void) createTabBarController
{
[ ShowTabBarController showTabBar : self.navigationController.tabBarController ] ;
NSMutableArray * viewControllers = [ [ NSMutableArray alloc ] init ] ;
UITabBarController * TabBarController = [ [ UITabBarController alloc ] init ] ;
ViewController * viewController = [ [ ViewController alloc ] initWithNibName : @ " ViewController " bundle: nil ] ;
UINavigationController * navigationController = [ [ UINavigationController alloc ] initWithRootViewController : ViewController ] ;
[ ViewControllers addObject : navigationController ] ;
ViewController2 viewController2 * = [ [ VisitDetailsViewController alloc ] initWithNibName : @ " ViewController2 " bundle: nil ] ;
UINavigationController * navigationController2 = [ [ UINavigationController alloc ] initWithRootViewController : ViewController2 ] ;
[ ViewControllers addObject : navigationController2 ] ;
tabBarController.viewControllers = viewControllers ;
self.navigationController.tabBarController.viewControllers = tabBarController.viewControllers ;
} .
在 ViewController 和 ViewViewController2 中都有这个方法来推送 ViewList。
-(void)pushTableList
{
[ShowTabBarController hideTabBar:self.tabBarController];
PropertyListViewController *propertyList = [[PropertyListViewController alloc] initWithNibName:@"PropertyListViewController" bundle:nil];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDuration:0.75];
[self.navigationController pushViewController:propertyList animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
}
我现在的问题是:
- 当我在 ViewController2 pushTableList 中时,我要去 viewlist 。
- 然后选择另一行,执行 push ViewManager 和显示给我的视图是最后一个,在本例中为 ViewController2。
更新 :
我想单击表格单元格,然后推送 ViewController。问题是:我单击单元格,当我推送到 ViewList 时,视图显示 ViewContoller 2(这是我拥有的最后一个视图)。
新更新
1 - 推送并创建 UITabBArController
-(Void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexPath
{
PropertyManagerViewController propertyManagerViewController * = [[PropertyManagerViewController alloc] initWithNibName: @ "PropertyManagerViewController" bundle: nil];
[self.navigationController pushViewController: propertyManagerViewController animated: YES];
}
- (void) createTabBarController
{
[ ShowTabBarController showTabBar : self.navigationController.tabBarController ] ;
NSMutableArray * viewControllers = [ [ NSMutableArray alloc ] init ] ;
UITabBarController * TabBarController = [ [ UITabBarController alloc ] init ] ;
ViewController * viewController = [ [ ViewController alloc ] initWithNibName : @ " ViewController " bundle: nil ] ;
UINavigationController * navigationController = [ [ UINavigationController alloc ] initWithRootViewController : ViewController ] ;
[ ViewControllers addObject : navigationController ] ;
ViewController2 viewController2 * = [ [ VisitDetailsViewController alloc ] initWithNibName : @ " ViewController2 " bundle: nil ] ;
UINavigationController * navigationController2 = [ [ UINavigationController alloc ] initWithRootViewController : ViewController2 ] ;
[ ViewControllers addObject : navigationController2 ] ;
ViewController3 viewController3 * = [ [ VisitDetailsViewController alloc ] initWithNibName : @ " ViewController3 " bundle: nil ] ;
UINavigationController * navigationController3 = [ [ UINavigationController alloc ] initWithRootViewController : ViewController2 ] ;
[ ViewControllers addObject : navigationController3 ] ;
tabBarController.viewControllers = viewControllers ;
self.navigationController.tabBarController.viewControllers = tabBarController.viewControllers ;
}
2 - 选择 TabBarITem 访问详细信息并单击 UIBarButtonItem 属性列表
3 - 单击数据表的单元格。
4 - 这是我的问题。如果您回头看 tabbaritem 访问。我要你给我看 PropertyItem