比較簡單,也很實用,方法大同小異,僅做記錄,方法的系統記錄如下:
[self dismissViewControllerAnimated:YES completion:^{ // 這是從一個模態出來的頁面跳到tabbar的某一個頁面 AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; UITabBarController *tabViewController = (UITabBarController *) appDelegate.window.rootViewController; [tabViewController setSelectedIndex:2]; }];
需要跳轉的時候,跳即可