Browse Source

fix : Pushing the same view controller instance more than once is not supported

Marino Faggiana 7 years ago
parent
commit
72cb0cd100
1 changed files with 5 additions and 12 deletions
  1. 5 12
      iOSClient/Main/CCMain.m

+ 5 - 12
iOSClient/Main/CCMain.m

@@ -5783,20 +5783,13 @@
             
             // save self
             [app.listMainVC setObject:viewController forKey:serverUrlPush];
-        }
-        
-        if (viewController) {
-                
-            // OFF SearchBar
-            [viewController cancelSearchBar];
+            
+            [self.navigationController pushViewController:viewController animated:YES];
         
-            @try {
+        } else {
+           
+            if (viewController.isViewLoaded)
                 [self.navigationController pushViewController:viewController animated:YES];
-            } @catch (NSException *e) {
-                NSLog(@"Exception: %@", e);
-            } @finally {
-                NSLog(@"Push View Controller %@", nomeDir);
-            }
         }
     }
 }