initWithFrame" of sub-class of a NSOpenGLView is not called ?
21/08/04 09:31
I have subclassed NSOpenGLView and placed my view in IB, but initWithFrame is not called, what is wrong ?
When subclassing NSOpenGLView, you have two ways to place the view in IB:
either you drag into your window a NSOpenGLView either you drag a CustomView, and then chnage the class of the view to yours.
If you choose the first solution, initWithFrame WILL NOT BE CALLED: the initialization sequence is different but the OpenGL context will be initialized for you.
In the second case, initWithFrame will be called but you have to setup the OpenGL context yourself (pixel format, etc.).
For AppKit objects read from a Nib file, the method initWithCoder is called since the object is being de-archived, initWithFrame being or not called by initWithCoder should be considered as a feature not a specification of the implementation: don't rely on it in your code for future compatibility.
Authored by: Admin on Tuesday, October 12 2004 @ 07:06 AM BST
See also Apple's TN
either you drag into your window a NSOpenGLView either you drag a CustomView, and then chnage the class of the view to yours.
If you choose the first solution, initWithFrame WILL NOT BE CALLED: the initialization sequence is different but the OpenGL context will be initialized for you.
In the second case, initWithFrame will be called but you have to setup the OpenGL context yourself (pixel format, etc.).
For AppKit objects read from a Nib file, the method initWithCoder is called since the object is being de-archived, initWithFrame being or not called by initWithCoder should be considered as a feature not a specification of the implementation: don't rely on it in your code for future compatibility.
Authored by: Admin on Tuesday, October 12 2004 @ 07:06 AM BST
See also Apple's TN