0

我正在使用 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];
4

1 回答 1

0

尝试升级到较新版本的ECSlidingViewController. 至少版本 1.0.1。

于 2013-11-16T18:23:08.827 回答