故事板不包含带有标识符的视图控制器

故事板不包含带有标识符的视图控制器

本文介绍了故事板例外-故事板不包含带有标识符的视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在为iPhone和iPad开发iOS应用程序.我试图显示一个NavigationController来制作一个显示文件的模块.在iPhone上可以正常使用,但我无法在iPad上使用它.

I am currently developing an iOS application for both iPhone and iPad. I'm trying to show a NavigationController to make a module that shows files. In an iPhone it works just fine, but I can´t get it to work in iPad.

我遇到以下错误:

'Storyboard (<UIStoryboard: 0x919b200>) doesn't contain a view controller with identifier 'FilesNavigation''

这是代码:

case 10: // Files
{
  UINavigationController *navigationController = [storyboard instantiateViewControllerWithIdentifier:@"FilesNavigation"];

  FilesViewController *filesViewController = [storyboard instantiateViewControllerWithIdentifier:@"Files"];

  [navigationController pushViewController:filesViewController animated:YES];

  self.slidingViewController.topViewController = navigationController;

  break;
}

在我的情节提要中,我已经为导航控制器设置了情节提要ID.

And in my storyboard I have already set the Storyboard ID for the navigation controller.

>##Custom Class
>Class: UINavigationController
>##Identity
>Storyboard ID: FilesNavigation

我将此代码用于其他模块的switch/case块上的另一种情况,它也适用于iPad,这是我第一次遇到此错误.

I used this code for another case on the switch/case block for other module and it works for iPad too, its the first time that I have this error.

推荐答案

我知道了,问题是故事板没有在设备中更新.

I figured it out, the problem was that the Storyboard wasn't updating in the device.

  1. 从模拟器/iPhone/iPad卸载应用程序
  2. 产品>清洁
  3. 建立并建立运行

在此问题中的@ T0m_Twt答案中所述

As stated in @T0m_Twt's answer in this question

这篇关于故事板例外-故事板不包含带有标识符的视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 06:34