最近做項目一個需求要跳轉到主要制器MainTabbar上某一個分控制器上,總結一個簡單的友善的方法:
AppDelegate *delegate = (AppDelegate *)[[UIApplicationsharedApplication] delegate];
JKMainTabViewController *tab = (JKMainTabViewController *)delegate.window.rootViewController;
tab.selectedIndex = 2;//根據需求填寫要跳轉的控制器index
君凱商聯網-iOS-字唐名僧