瀏覽代碼

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

Marino Faggiana 7 年之前
父節點
當前提交
72cb0cd100
共有 1 個文件被更改,包括 5 次插入12 次删除
  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);
-            }
         }
     }
 }