您好,我添加了一個準備segue代碼以傳輸信息,但我收到一個錯誤。從視圖控制器轉換到標籤欄控制器與導航控制器在每個選項卡錯誤
我有一個標籤欄控制器。它有4個選項卡。每個選項卡都有一個導航控制器,以及一個VC作爲根視圖控制器。
從標籤1 - >導航控制器 - > VC 1我需要的值,以TAB2 - >導航控制器---> VC1
(也就是在連接到導航控制器的SEGUE選項卡,或者在標籤2根視圖) 預先感謝您
錯誤:customizableViewControllers]:無法識別的選擇發送到實例0xf19bd60 (但我要標籤2(索引1))? 我的錯誤在哪裏?
if ([segue.identifier isEqualToString:@"ResultsSegue"])
{
//the root VC at tab 2
ResultsIndexViewController*controller=[[ResultsIndexViewController alloc]init];
UITabBarController *tabController = [segue destinationViewController];
controller = (ResultsIndexViewController*)[[tabController customizableViewControllers]objectAtIndex:1];//crashing here
controller.resultsArray=[NSMutableArray arrayWithArray:_matchedResultsArray];
}
}
另外,我需要這方面的代表嗎? –
你的錯誤基本上意味着,'tabbarcontroller'不是'UITabBarController'。可以肯定,'[segue destinationViewController]'返回一個'UITabBarController'?那是,如何配置賽格? – SAE
該segue去一個導航控制器,它應該鏈接到tabbar控制器? –