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
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.