• 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: Cocoa Open GL help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Open GL help


  • Subject: Re: Cocoa Open GL help
  • From: Peter Ammon <email@hidden>
  • Date: Wed, 12 Sep 2001 15:32:38 -0400

On Wednesday, September 12, 2001, at 03:57 AM, Raphael Sebbe wrote:


On Tuesday, September 11, 2001, at 11:55 PM, Vince DeMarco wrote:

initWithFrame: will only get called for a CustomView, or in the case of a customobject we will call init.

In every other case we basically go though the NSCoder stuff and call initWithCoder: when the object gets read out of the nib file.

But i would not recommend over riding the initWithCoder: (unless you are really careful). Just add a awakeFromNib method and do the initialization that you need there. awakeFromNib gets called on all of the objects in the nib after all of the connections have been made. This is the safest way of doing this.

I can't see a case where a class defined by the user could override -initWithCoder: and that it would be called when the nib is loaded (except for categories and poseAsClass stuff...). This is because IB does not encode classes for which it doesn't have access to their implementation (that is all classes outside of AppKit/Foundation).

As we were talking about MyOpenGLView, subclass of NSOpenGLView from the previous posts, that is why I suggested -initWithFrame: for initialization stuff, which for me is different from setup stuff (-awakeFromNib).

Raphael

FYI, NSOpenGLViews are initialized from IB using initWithFrame: pixelFormat:, not initWithFrame:. If you want to initialize it in the init method, that's the one to override.

-Peter


  • Follow-Ups:
    • Re: Cocoa Open GL help
      • From: Raphael Sebbe <email@hidden>
    • Re: Cocoa Open GL help
      • From: Vince DeMarco <email@hidden>
References: 
 >Re: Cocoa Open GL help (From: Raphael Sebbe <email@hidden>)

  • Prev by Date: Re: make that dataSource (was Re: an interesting delegate design issue raised by IB...)
  • Next by Date: Re: A category for NSMatrix?
  • Previous by thread: Re: Cocoa Open GL help
  • Next by thread: Re: Cocoa Open GL help
  • Index(es):
    • Date
    • Thread