I am using ECSlidingViewController, I use the initialSlidingViewController to check if the user is authenticated, nothing complicated but it doesn't work, please help.
#import "Landing2ViewController.h"
#import "Home2ViewController.h"
#import "API.h"
#import "MBProgressHUD.h"
@interface Landing2ViewController ()
@end
@implementation Landing2ViewController
- (void)viewDidLoad {
[super viewDidLoad];
UIStoryboard *storyboard;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
} else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
storyboard = [UIStoryboard storyboardWithName:@"iPad" bundle:nil];
}
[self Authenticate];
self.view.layer.zPosition = 2;
}
-(void) Authenticate
{
if ([API sharedAPIInstance].isAuthorized)
{
self.topViewController = [storyboard instantiateViewControllerWithIdentifier:@"Home2Dialog"];
}
else
{
self.topViewController = [storyboard instantiateViewControllerWithIdentifier:@"Login2Dialog"];
}
};
- (void)viewDidUnload {
// [self setNavigationBar:nil];
[super viewDidUnload];
}
@end
All I get is...breakpoint is line 108 ECSligingViewController.m
'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
[self addChildViewController:self.topViewController];