相关疑难解决方法(0)

STORYBOARD EXCEPTION - Storyboard不包含带标识符的视图控制器

我目前正在为iPhone和iPad开发iOS应用程序.我正在尝试显示一个NavigationController来创建一个显示文件的模块.在iPhone中它工作得很好,但我不能让它在iPad上工作.

我收到以下错误:

'Storyboard (<UIStoryboard: 0x919b200>) doesn't contain a view controller with identifier 'FilesNavigation''
Run Code Online (Sandbox Code Playgroud)

这是代码:

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

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

  [navigationController pushViewController:filesViewController animated:YES];

  self.slidingViewController.topViewController = navigationController;

  break;
}
Run Code Online (Sandbox Code Playgroud)

在我的故事板中,我已经为导航控制器设置了Storyboard ID.

>##Custom Class 
>Class: UINavigationController
>##Identity
>Storyboard ID: FilesNavigation
Run Code Online (Sandbox Code Playgroud)

我将此代码用于其他模块的开关/外壳块上的另一个案例,它也适用于iPad,这是我第一次遇到此错误.

xcode storyboard ios

19
推荐指数
3
解决办法
2万
查看次数

标签 统计

ios ×1

storyboard ×1

xcode ×1