2010-06-22 63 views
0

我一直在这个问题上停留了一段时间。我有一个UIVIEW(SelectionScreen)已被推入使用NavigationBar PushViewController不工作

SelectionScreen *aSelectionScreenViewController =[[SelectionScreen alloc]initWithNibName:@"SelectionScreen" bundle:nil]; 
self.navigationController pushViewController:aSelectionScreenViewController animated:YES] 

[aSelectionScreenViewController release]; 

这工作正常。但现在问题出现在这个班上。这个类实际上拥有另一个名为SelectionScreenTable的类。因此,建筑会是这样 SelectionScreen -SelectionScreenTable

所以现在在SelectionScreenTable.m文件 我尝试推动其他类(类称为Graph.h),但它不工作的didSelectRow方法,我的代码使用与上述完全相同。

因此,我试图在应用程序的mainFlow开头推图,只是为了看看我的代码是否工作或错误,是的,它的工作。

所以我想知道,我该如何解决这个问题?检测超类,然后将视图推入超视图? IM虽然OBJ-C newb,代码和示例会很好。任何想法家伙?感谢阅读btw

+0

问题出在我的SelectionScreen上吗? SelectionScreen通过将SelectionScreenTable添加为子视图来保存SelectionScreenTable。这是我如何让我的SelectionScreen“保留”SelectionScreenTable – Kenneth 2010-06-22 09:35:05

+0

SelectionScreen.m SelectionScreenTable * aSelectionScreenTableViewController = [[SelectionScreenTable alloc] initWithNibName @“selectionScreenTable”bundle:nil]; aSelectionScreenTableViewController.view.bounds = CGRectMake(0,0,896,613); aSelectionScreenTableViewController.view.center = CGPointMake(576,380); [self.view addSubview:aSelectionScreenTableViewController.view]; – Kenneth 2010-06-22 09:35:31

回答

0

我解决了它通过使用过渡动画代替。 。

GraphView *viewController =[[GraphView alloc]initWithNibName:@"GraphView" bundle:nil]; 
    viewController.view.transform = CGAffineTransformMakeRotation(-3.14 *(0)/180.0); 
    viewController.view.bounds = CGRectMake(0,0,1025,769); 
    viewController.view.center = CGPointMake(512.5, 374.5); 

    UIView *theCurrentView = self.view; 
    UIView *theWindow = [theCurrentView superview]; 
    [theCurrentView removeFromSuperview]; 
    [theWindow addSubview:viewController.view]; 

    CATransition *animation = [CATransition animation]; 
    [animation setDuration:0.35]; 
    [animation setType: kCATransitionPush]; 
    [animation setSubtype:kCATransitionFromTop]; 
    [animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]]; 
    [[theWindow layer] addAnimation:animation forKey:@"SwitchToGraphView"]; 
    [viewController release]; 
相关问题