0
當我點擊後退按鈕,然後我加載一個特定的view.But到那個特定的視圖,我必須添加一個tabbarController.How我可以做到嗎??當我嘗試添加它不會得到添加..不知道y?當在xcode中點擊後退按鈕時加載tabbarcontroller?
-(IBAction)switchtofirst {
AppViewController *first=[[AppViewController alloc] initWithNibName:@"AppViewController" bundle:nil];
Login *second=[[Login alloc]initWithNibName:@"Login" bundle:nil];
[email protected]"Login";
NSArray *viewArray=[[NSArray alloc] initWithObjects: first,second,nil];
tabBarController=[[UITabBarController alloc] init];
[tabBarController setViewControllers:viewArray animated:NO];
AppViewController *gp=[AppViewController alloc];
[gp.view addSubview:tabBarController.view];
[self presentModalViewController:gp animated:NO];
[gp release];
}
即時得到錯誤: 「計劃收到SIGABRT」 在這一行:自presentViewController:tabBarController動畫:是完成:無]; u能告訴我如何糾正它? – Honey
K知道了...謝謝你... – Honey
感謝您的回答@bbodayle。解決了我的頭痛。 + 1爲一個很好的答案。 –