2011-05-19 87 views

回答

2

您不必爲此應用(或應該)使用後臺線程。只需將導航控制器的委託,實施方法

- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated 

然後,您可以存儲在一個實例變量的當前活動視圖控制器。

0
for (UIView *view in self.navigationController.view.subviews) 
{ 
} 
1

存在UINavigationController屬性爲(來自here):

topViewController

在導航堆棧的頂部的視圖控制器。 (只讀)

@屬性(非原子,只讀,保留)的UIViewController * topViewController

簡單地做:

UIViewController* topController = navigationController.topViewController; 
-1

爲(UINavigationController的*視圖self.view.subviews) { }

相關問題