我在iOS中有一個項目,我試圖修改它在另一個項目中使用。該項目工作正常,但是當我在標籤欄控制器嘗試嵌入側視圖控制器,則給了一個錯誤容器V中的父子視圖
**MFSideMenuDemoStoryboard[23760:c07] -[UITabBarController setLeftMenuViewController:]: unrecognized selector sent to instance 0x757a590
2013-06-13 10:08:51.062 MFSideMenuDemoStoryboard[23760:c07] **** * * **Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITabBarController setLeftMenuViewController:]: unrecognized selector sent to instance 0x757a590'**
據我所知,有一些錯誤在代碼中appDelegate
.M但不能弄清楚
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:[NSBundle mainBundle]];
MFSideMenuContainerViewController *container = (MFSideMenuContainerViewController *)self.window.rootViewController;
UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"navigationController"];
UIViewController *leftSideMenuViewController = [storyboard instantiateViewControllerWithIdentifier:@"leftSideMenuViewController"];
UIViewController *rightSideMenuViewController = [storyboard instantiateViewControllerWithIdentifier:@"rightSideMenuViewController"];
[container setLeftMenuViewController:leftSideMenuViewController];
[container setRightMenuViewController:rightSideMenuViewController];
[container setCenterViewController:navigationController];
return YES;
}
這是我的故事板
您好Matthias,感謝您的幫助,試過這段代碼,但它仍然沒有調出中央視圖控制器,在這個例子中恰好是演示視圖控制器,如果你可以更詳細說明會有很大的幫助。謝謝,基本上我認爲問題是與'代碼'tabBarController SetView控制器: – iSrini
嗨最後搞清楚了,修改了一下代碼,並得到它完美的工作。 我想把最終的代碼放在這裏供其他人蔘考,以後如何去做。評論部分太小而無法將它們放在這裏。 – iSrini
@Matthua Bauch 您好Matthias Bauch,我有另一個問題可能是你可以幫我用它 [鏈接](http://stackoverflow.com/questions/17531648/implementing-a-split-view-controller- under-a-tab-bar-controller)** bold ** 謝謝 – iSrini