2014-01-08 45 views
1

我已經從「master-detail」模板中刪除了「detail」navigationController,將它正確地重新連接到tabBarController並將「detail」viewController移動到第一個選項卡。將TabBarController添加到splitViewController

然後我得到這個錯誤:

2014年1月7日21:11:20.364主詳細[3033:70B] - [UITabBarController topViewController]:無法識別的選擇發送到實例0x9e46e70 2014年1月7日21:11 :20.366主 - [3033:70B] *終止應用程序由於未捕獲的異常「NSInvalidArgumentException」,原因:「 - [UITabBarController topViewController]:無法識別的選擇發送到實例0x9e46e70」

所以我代替這條線在函數「應用 - didFinishLaunchingWithOptions 「: ...

UINavigationController *navigationController = [splitViewController.viewControllers lastObject]; 

對於:

UITabBarController *tabBarController = [splitViewController.viewControllers lastObject]; 
UINavigationController *navigationController = tabBarController.viewControllers[0]; 

但仍然: 2014年1月7日20:59:38.377 EngLogBook [2955:70B] - [elbDetailViewController topViewController]:無法識別的選擇發送到實例0x8d86ff0 2014年1月7日20:59:38.380 EngLogBook [2955:70B] *終止應用程序由於未捕獲的異常 'NSInvalidArgumentException',原因是: ' - [elbDetailViewController topViewController]:無法識別的選擇發送到實例0x8d86ff0'

有什麼不對?

適用於iPad和iPhone故事板。 iPhone的工作很棒,但iPad很雜亂。

回答

0

您所描述的內容聽起來不像使用標準的UIKit工具。您可能想重新考慮如何構建和佈局界面。蘋果有文件應該提供一些指導。

Apple Human Interface Guidelines - Navigation

+0

它的工作在iPhone上,有人做到了,看到這個線程: http://stackoverflow.com/questions/16576984/create-a-tabbar-controller-with-a-master-detail-模板 但是沒有給出關於細節部分的線索。 – MPLT

相關問題