iOS 在TabViewController中的一个ViewController跳转到另一种ViewController

第一步:

#import "AppDelegate.h"

步骤二:

在须要跳转的地方:

    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    UITabBarController *tabViewController = (UITabBarController *) appDelegate.window.rootViewController;
    [tabViewController setSelectedIndex:2];

參考:

http://stackoverflow.com/questions/10307350/any-code-example-of-how-access-viewcontroller-from-uitabbarcontroller

原文地址:https://www.cnblogs.com/yxwkf/p/4602322.html