0

我正在按照教程制作一个滑动应用程序。

我在我的项目中添加了ECSlidingViewController

我只执行了教程中的几个步骤,然后我遇到了错误。

除了教程中的代码之外,我什么都没写过代码,即

    - (void)viewDidLoad
{
  [super viewDidLoad];
self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ToDoView"];
}

当我运行应用程序时,我的应用程序崩溃并显示此错误:

Terminating app due to uncaught exception 'Missing topViewController', 
reason: 'Set the topViewController before loading ECSlidingViewController'

我搜索了谷歌并尝试了很多方法,其中一些是形成链接:

第一个链接

第二环节

我找不到任何真正的解决方案。

4

1 回答 1

1

当我在 ViewDidLoad 它的工作文件中交换行时,这很奇怪:

  - (void)viewDidLoad
{

  self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"ToDoView"];

   [super viewDidLoad];

 }
于 2015-04-22T10:19:30.720 回答