Re: Hiding superclass methods
Re: Hiding superclass methods
- Subject: Re: Hiding superclass methods
- From: Nathan Day <email@hidden>
- Date: Sat, 11 May 2002 02:02:39 +0930
initWithFrame: is called for custom classes that are added to your
interface file with the Custom view icon in IB pallet. If you subclass
one of the view classes in interface builder (NSButton,NSMatrix etc)
then initWithCoder: called. My understanding of the reason is that the
custom view icon doesn't create a view to be archive but creates some
sort of place holder instead, whereas the other view objects are
archived and so initWithCoder: is called to un-archive them.
On Saturday, May 11, 2002, at 01:50 AM, email@hidden wrote:
No, initWithFrame: just isn't called. According to the Cocoa
documentation, "the init and initWithFrame: methods are never called
when a nib file is opened. As you create a nib file, Interface Builder
automatically initializes its elements. When you later load that nib
file, all its elements are already initialized." (in
/Developer/Documentation/Cocoa/TasksAndConcepts/ProgrammingTopics/LoadingResources/
Concepts/NibFileLoaded.html). My personal experience (including
deliberate experimentation about just this question) supports this.
AwakeFromNib is where objects (views or not) loaded from nib files must
be initialized. (Granted, the documentation could be wrong. If it is,
and initWithFrame: *does* sometimes get called for views loaded from
nib files, I strongly encourage you to post a bug report about it, and,
for my edification, could you describe an example that demonstrates
initWithFrame: being called?)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.