• 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: Raphael Sebbe <email@hidden>
  • Date: Wed, 12 Sep 2001 18:15:49 +0200

On Wednesday, September 12, 2001, at 05:53 PM, Vince DeMarco wrote:

Yes this is true. If you select a NSButton and in IB make a subclass of NSButton called MyButton, when you set the custom class of NSButton to MyButton, we actually write out (encode) and NSButton, but tell NSArchiver to swap an instance of NSButton with MyButton.

So if youre MyButton initWithCoder: is expecting some data in the stream you will get an error and it will not work.

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).



If you use a CustomView and set the class to MyOpenGLView then initWithFrame: will get called but if MyOpenGLView is set as a custom class to the NSOpenGLView that you drag in from the palette, the initWithFrame: method on MyOpenGLView will never get called.

Am i just confusing everyone or is this explanation helping????



No, this is a nice explanation... I did not know about that mecanism (choosing a subclass in IB without using CustomView) and substitution at load-time. And it is richer too, as it lets you set the superclass properties; the drawback being that we must be careful with NSCoder stuff.

Thanks,

Raphael


References: 
 >Re: Cocoa Open GL help (From: Vince DeMarco <email@hidden>)

  • Prev by Date: Re: *That* book
  • Next by Date: Re: *That* book
  • Previous by thread: Re: Cocoa Open GL help
  • Next by thread: Re: Cocoa Open GL help
  • Index(es):
    • Date
    • Thread