Wolfgang,

Each of the objects in gui knows how to archive itself.  Gorm manages the 
object tree and allows you to edit the objects, but doesn't produce the archive 
itself... that's done by NSArchiver and NSKeyedArchiver for gorm and nib files 
respectively.

The change to fix this issue is rather simple.   I believe that the 
initWithCoder: method in NSWindowController calls the super version of that 
method.  What needs to be done is to bump the version of the class and make it 
so that the current version calls super initWithCoder and the old version 
doesn't.   That should, I believe, solve the issue.

Later, GC

 Gregory Casamento -- Principal Consultant - OLC, Inc 
# GNUstep Chief Maintainer




________________________________
From: Wolfgang Lux <[EMAIL PROTECTED]>
To: David Ayers <[EMAIL PROTECTED]>
Cc: Fred Kiefer <[EMAIL PROTECTED]>; DISCUSS GNUstep <[email protected]>
Sent: Thursday, October 23, 2008 1:24:25 PM
Subject: Re: NSWindowController should be a NSResponder

David Ayers wrote:

> The change is good and correct for trunk but what's more  
> interesting ist
> that you probably have to consider NSCoding implication for non-keyed
> un/archivers... this seems non trivial to fix.

Archiving, oh yes. Thanks for pointing out that I have overlooked
archiving. By chance, (un)archiving simply continued to work because
the current implementations of -initWithCoder: and -encodeWithCoder:
sloppily do not call their superclass implementations (-inithWithCoder:
uses -init instead). So, we loose the ability to archive the inherited
interfaceStyle and menu attributes of the window controller. When keyed
archiving is used this is trivially fixed by calling the super class
implementations. In order to get non-keyed archiving to work we'll have
to increase the class version number of NSWindowController and depending
on the version used during (un)archiving either call the super class
implementation or use the old implementation, i.e., effectively do
nothing. I have attached a patch below.

Apparently, Gorm must be changed as well to take care of writing
backward compatible archives for older gui versions. Someone out
there willing to implement that before I delve into Gorm's sources?

Wolfgang


      
_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to