0
A
回答
0
當然可以。
看看UINavigationController的viewControllers
屬性。
返回用戶當前正在查看的視圖控制器的數組。因此,查看最後一個視圖控制器(或「n-2,其中n是數組中的項目數量」,according to the Apple documentation I linked for you),並且您可以從該視圖控制器的導航欄中獲取標題。
0
NSMutableArray *activeControllerArray = [self.navigationController.viewControllers mutableCopy];
ControllerA myController;
For(int i = 0, i <[activeControllerArray count], i++) {
if([[activeViewController objectAtIndex:i] isKindOfClass:[ControllerA class]) {
myController = [activeViewController objectAtIndex:i];
NSLog(@"%@",myController.title);
}
}
0
ViewControllerA * viewA =(ViewControllerA *)[self.navigationController.viewControllers objectAtIndex:self.navigationController.viewControllers.count-2];
NSLog(@「%@」,viewA.title);
0
A類 .m文件
{
NSString *titleA = @"Khalid";
ClassB *bObj = [[ClassB alloc] init];
bObj.title = titleA;
[self.navigationController pushViewController:bObj animated:YES];
}
相關問題
- 1. WPF:獲取下一個/上一個可視對象
- 2. 在某個點獲取可見視圖
- 3. Android的SuperSlim:獲取第一個標題視圖
- 4. 可可單視圖問題
- 5. 獲取視圖的可見區域
- 6. 獲取視圖的可見高度
- 7. Android - 獲取視圖的可見區域?
- 8. 獲取可用的Drupal視圖列表
- 9. 地圖上的標題blackberry上的標題不可見
- 10. iPhone在另一個視圖之上的可擴展視圖
- 11. 是否有可能在同一視圖中獲取多個MPMoviePlayerControllers?
- 12. 如何從Android ListView獲取第一個可見視圖
- 13. 可重複使用TableView標題視圖
- 14. 從可可中的窗口標識獲取應用圖標
- 15. 在grails視圖中獲取標題
- 16. 從可可中加入一個視圖
- 17. 如何獲得樹型視圖的可用(可視)的寬度一個TreeView
- 18. 在pageController中獲取可見視圖
- 19. 在另一個視圖中獲取一個視圖的參數
- 20. 獲取ndarray的重新陣列視圖(也可以是視圖)
- 21. 獲取多個選定的行信息的一個可用視圖
- 22. 是否可以錨定表視圖標題(不是節標題)
- 23. 我可以在列表視圖中混合標題標題
- 24. 在Google可視化餅圖[corechart]中獲取點擊標籤
- 25. 獲取可可中的特殊路徑的圖標
- 26. 從靜態表格視圖獲取標題標題
- 27. 在地圖上獲取可見標記的最有效方法?
- 28. Android可滾動結果視圖和可滾動標題部分
- 29. 是否有可能在一個expandable的標題中的項目列表視圖
- 30. 可可NSImage全視圖問題