Commits

Mike Abdullah  committed 4cf2bab

Were lying to controllers that they were appearing when in fact were releasing

  • Participants
  • Parent commits c601f81

Comments (0)

Files changed (1)

File BWTabViewController.m

     }
     
     
-    // Keep selection in sync
-    [[self selectedViewController] viewWillAppear:NO];
-    
-    [tabView bind:NSSelectedIndexBinding
-         toObject:self
-      withKeyPath:@"selectedIndex"
-          options:nil];
-    
-    [[self selectedViewController] viewDidAppear:NO];
+    // Keep selection in sync. It would be lying to the controller if tabview is nil, sinc it isn't really appearing. And sending -bind:… to nil has no effect, so is safe to skip
+    if (tabView)
+    {
+        [[self selectedViewController] viewWillAppear:NO];
+        
+        [tabView bind:NSSelectedIndexBinding
+             toObject:self
+          withKeyPath:@"selectedIndex"
+              options:nil];
+        
+        [[self selectedViewController] viewDidAppear:NO];
+    }
 }
 
 - (BOOL)isTabViewLoaded { return (_tabView != nil); }