1

I am using ECSlidingViewController.

What I want that if my app is first launch the I Want to show Terms and Conditions and when User Accepts it then I am changing ViewController to ECSlidingViewController

My Code is:

 - (IBAction)didTapAccept:(id)sender
 {
       ECSlidingViewController *nextScr = (ECSlidingViewController *) [self.storyboard instantiateViewControllerWithIdentifier:@"ECSlidingViewController"];
       [self.navigationController pushViewController:nextScr animated:YES];
 }

Problem: The Problem is that When my app runs first time the app crashes without giving any log or warning, after i stop and run again it works fine.

My Storyboard Setup enter image description here

When I Debug i found that my app crashes in ECSlidingViewController.m file. But it is a library file so haven't changed anything.

Code From ECSlidingViewController.m

    - (void)viewDidLoad {
if (!self.topViewController)
{
    [NSException raise:@"Missing topViewController"
                                         format:@"Set the topViewController before loading ECSlidingViewController"];
}
self.topViewController.view.frame = [self topViewCalculatedFrameForPosition:self.currentTopViewPosition]; //crashes
[self.view addSubview:self.topViewController.view];
[super viewDidLoad];

}

I have mentioned where the app crahses. But In second time run it works fine. What's the issue with it.

Bhavin Bhadani
  • 22,224
  • 10
  • 78
  • 108
Rahul
  • 5,594
  • 7
  • 38
  • 92

0 Answers0