Error: "unrecognized selector sent to instance" of MFSideMenuContainerViewController

104 views Asked by At

This is my code:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor whiteColor];
    //侧滑菜单
    YZTabBarController *tabBarController = [[YZTabBarController alloc]init];
    YZPesonalCenterViewController *personalVC = [[YZPesonalCenterViewController alloc]init];
    MFSideMenuContainerViewController *container = [MFSideMenuContainerViewController containerWithCenterViewController:tabBarController leftMenuViewController:personalVC rightMenuViewController:nil];
    self.window.rootViewController = container;//[[YZTabBarController alloc] init];
    [self.window makeKeyAndVisible];
    NSShadow *titleShadow = [[NSShadow alloc] init];
    titleShadow.shadowOffset = CGSizeMake(0, 0);
    titleShadow.shadowColor = [UIColor lightGrayColor];
    NSDictionary *titleAttrs = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], NSForegroundColorAttributeName, titleShadow, NSShadowAttributeName, [UIFont boldSystemFontOfSize:18.0], NSFontAttributeName, nil];
    [[UINavigationBar appearance] setTitleTextAttributes:titleAttrs];
    [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]];
    [[UINavigationBar appearance] setBackgroundImage:[UIImage imageNamed:@"navi_back"] forBarMetrics:UIBarMetricsDefault];

    // 键盘设置
    IQKeyboardManager *sharedManager = [IQKeyboardManager sharedManager];
    sharedManager.shouldResignOnTouchOutside = YES;
    sharedManager.enableAutoToolbar = YES;

    //设置状态栏样式
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];

    return YES;
}

and the error is:

app due to uncaught exception 'NSInvalidArgumentException',
reason: '-[MFSideMenuContainerViewController tabBar]:
unrecognized selector sent to instance 0x7ff6fb16f780'

0

There are 0 answers