我正在使用ECSlidingViewController,我使用initialSlidingViewController来检查用户是否经过身份验证,没有什么复杂但它不起作用,请帮忙。
#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
我得到的全部是......断点是第108行ECSligingViewController.m
'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
[self addChildViewController:self.topViewController];
答案 0 :(得分:0)
尝试升级到较新版本的ECSlidingViewController
。至少版本1.0.1。