2010-06-22 157 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]; 
相關問題