1

这是我的代码:

- (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;
}

错误是:

应用程序由于未捕获的异常“NSInvalidArgumentException”,
原因:“-[MFSideMenuContainerViewController tabBar]:
无法识别的选择器发送到实例 0x7ff6fb16f780”

4

0 回答 0