Re: Multiple instantiations of variables & class
Re: Multiple instantiations of variables & class
- Subject: Re: Multiple instantiations of variables & class
- From: Ondra Cada <email@hidden>
- Date: Sun, 24 Mar 2002 13:39:16 +0100
On Sunday, March 24, 2002, at 07:36 , Chad Armstrong wrote:
Below is a description of my problem I'm having with mysterious
difficulties with variables.
I put a printf statement in my - (id)initWithFrame:(NSRect)frame function
in my EGView.h file (which is responsible for drawing to the custom
NSView), and the printf function revealed that the function was being
called 3 times! One time it seems to be called from the MainNib.nib in
the Interface Builder since I added the EGView class, and another one is
when I declare an instance of the class in my main controller class.
However, there seems to be one more mysterious and hidden call to this
function...any ideas? Or should I change -(id) initWithFrame to just an
-(id)init function?
To get more precise answer you should show us the stacks (just use "bt" in
gdb). Otherwise,
- as for the NIB call, it's normal: NIBbed CustomViews are created using
initWithFrame:;
- as for the "when I declare an instance" it is for sure not true: you
declare an instance in @interface when writing your code, and I bet at
_that_ time nothing is called!
I guess instead you might mean the moment when you fill the property, like
myEGView=[EGView egViewWithSomething...];
? If so, it's again normal.
As for the third time, sorry, but with the information available I can't
even guess.
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
2K Development: email@hidden
http://www.2kdevelopment.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
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.