Commits

Anonymous committed 002e301

Tab View Controller supports -initWithCoder: properly

  • Participants
  • Parent commits b892511

Comments (0)

Files changed (1)

BWTabViewController.m

 {
     if (self = [super initWithCoder:decoder])
     {
+        [self setIdentifier:[decoder decodeObjectForKey:@"identifier"]];
+        
+        NSTabView *tabView = [decoder decodeObjectForKey:@"tabView"];
+        if (tabView) [self setTabView:tabView];
+        
+        // Make sure ivars have been initialized before unarchiving view controllers
         [self didInit];
+        NSArray *controllers = [decoder decodeObjectForKey:@"viewControllers"];
+        for (NSViewController *aController in controllers)
+        {
+            [self addViewController:aController];
+        }
     }
+    
     return self;
 }