gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Double initialization of custom (text) views in Gorm files


From: Gregory John Casamento
Subject: Re: Double initialization of custom (text) views in Gorm files
Date: Thu, 20 Nov 2008 16:44:03 -0800 (PST)

Wolfgang,

These are what are known as "designated initializers" they are called on objects when a nib is instantiated on instances of custom classes only.   This is what is described in Apple's documentation and fits with observed behavior on OpenStep and on Cocoa.

If we can find a cleaner implementation for this, then I would suggest that we do that rather than removing the code.

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



From: Wolfgang Lux <address@hidden>
To: address@hidden
Sent: Thursday, November 20, 2008 4:25:05 PM
Subject: Double initialization of custom (text) views in Gorm files

The -initWithCoder: method of GSTextViewTemplate in GSNibTemplates invokes
the -initWithFrame:textContainer: initializer on self if the custom subclass
of NSTextView implements that method. Unfortunately, this leads to a double
initialization of instances and, in particular, any customization applied to
the text view in the Gorm file will be lost. If anybody is relying on this
weird semantics, I just wanted to inform you that I intend to remove that
code, since it is definitely wrong (and neither compatible with the Cocoa
documentation nor Apple's implementation). The correct way to initialize
custom subclasses of NSTextView loaded from a nib file is either via
-awakeFromNib or by providing a palette for Interface Builder so that the
additional attributes of the custom class can be changed and archived. (Is
this possible in Gorm?)

Similar code is present in GSViewTemplate, GSTextTemplate, GSMenuTemplate,
GSControlTemplate, and GSObjectTemplate and I intend to remove that, too.

Wolfgang



_______________________________________________
Gnustep-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnustep-dev


reply via email to

[Prev in Thread] Current Thread [Next in Thread]