Set the topViewController before loading ECSlidingViewController

658 Views Asked by At

I am following this tutorial to make a Sliding app.

I have added the ECSlidingViewController in my project.

I have performed only few steps from the tutorial then I have encountered the error.

I have written nothing in code except the code from tutorial i.e.

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

When I run the app my app crashes and showing me this error:

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

I searched google and Tried many ways some of them are form the links:

First Link

Second Link

I am not able to find any genuine solution.

1

There are 1 best solutions below

0
On

It's Strange when i Interchange the lines in ViewDidLoad it works file:

  - (void)viewDidLoad
{

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

   [super viewDidLoad];

 }