marinofaggiana 5 년 전
부모
커밋
cc96d1238e
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      iOSClient/AppDelegate.m

+ 7 - 4
iOSClient/AppDelegate.m

@@ -689,16 +689,19 @@
             
             if (splitViewController.isCollapsed) {
                             
+                [navigationControllerMaster popToRootViewControllerAnimated:false];
+                UINavigationController *navigationControllerMaster = (UINavigationController *)splitViewController.viewControllers.firstObject;
+                UITabBarController *tabBarController = (UITabBarController *)navigationControllerMaster.topViewController;
+                
                 if ([tabBarController isKindOfClass:[UITabBarController class]]) {
                     [tabBarController setSelectedIndex: k_tabBarApplicationIndexMedia];
                 } 
                 
             } else {
             
-                UINavigationController *navgigationControllerDetail = splitViewController.viewControllers.lastObject;
-                [navgigationControllerDetail popToRootViewControllerAnimated:NO];
-            
-                [tabBarController setSelectedIndex: k_tabBarApplicationIndexMedia];
+                if ([tabBarController isKindOfClass:[UITabBarController class]]) {
+                    [tabBarController setSelectedIndex: k_tabBarApplicationIndexMedia];
+                }
             }
         });