• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Hiding superclass methods
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Hiding superclass methods (From: email@hidden)

  • Prev by Date: Re: Java to Cocoa help request
  • Next by Date: Re: List of delegates
  • Previous by thread: Re: Hiding superclass methods
  • Next by thread: Re: Hiding superclass methods
  • Index(es):
    • Date
    • Thread