ios 导航栏回退和分栏切换同时进行时,导航回退不执行解决方法

2019-03-02  本文已影响0人  紫释沐沐

1.异步执行导航栏控制器回退回跟页面,以下vc为当前控制器

dispatch_async(dispatch_get_main_queue(), ^{

        [vc.navigationController popToRootViewControllerAnimated:NO];

    });

2.分栏切换显示页

AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate;

UITabBarController *tabbarCtr = (UITabBarController *)delegate.window.rootViewController;

[tabbarCtr setSelectedIndex:index];

上一篇 下一篇

猜你喜欢

热点阅读