Revision: 5287
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5287&view=rev
Author:   hofman
Date:     2009-03-30 12:53:33 +0000 (Mon, 30 Mar 2009)

Log Message:
-----------
Encode contentview of BDSKContainerView as a conditional object

Modified Paths:
--------------
    trunk/BDSKContainerView.m

Modified: trunk/BDSKContainerView.m
===================================================================
--- trunk/BDSKContainerView.m   2009-03-30 12:40:49 UTC (rev 5286)
+++ trunk/BDSKContainerView.m   2009-03-30 12:53:33 UTC (rev 5287)
@@ -53,17 +53,18 @@
 
 - (id)initWithCoder:(NSCoder *)decoder {
        if (self = [super initWithCoder:decoder]) {
-               if ([[super subviews] count]) { // not sure if this works OK, 
but we're not using it now as IB calls initWithFrame
-                       [self setContentView:[[super subviews] 
objectAtIndex:0]];
-               } else {
-                       contentView = [[NSView alloc] initWithFrame:[self 
contentRect]];
-                       [super addSubview:contentView];
-                       [contentView release];
-               }
+               // this decodes only the reference, the actual view should 
already be decoded as a subview
+        contentView = [coder decodeObjectForKey:@"contentView"];
        }
        return self;
 }
 
+- (void)encodeWithCoder:(NSCoder *)coder {
+  [super encodeWithCoder:coder];
+  // this encodes only a reference, the actual contentView should already be 
encoded because it's a subview
+  [coder encodeConditionalObject:contentView forKey:@"contentView"];
+}
+
 - (id)contentView {
        return contentView;
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to