Re: Example DotView from Learning Cocoa.
Re: Example DotView from Learning Cocoa.
- Subject: Re: Example DotView from Learning Cocoa.
- From: Lamar Williams <email@hidden>
- Date: Sun, 16 Sep 2001 09:08:53 -0700
I want to thank all who helped me understand this problem:
David Rehring, David P. Henderson, Dave Fayram, Simon Stapleton
and Brendan Younger.
You all where correct, quoting Brendan:
"When you drag a view (color well or slider in this case) from the
palette to the window, you have implicitly created that object. In the
MainMenu.nib window, you will not see any graphic representation that
that class has been added to the nib. You will (usually) only see the
window object in which your slider and color well exist. This is
because the slider and color well are not "top-level objects". That
means that the window into which you've added those views is responsible
for them and if you delete the window, the views go bye-bye as well.
Now, "deleting the instance" of DotView as you describe it is actually
you deleting a completely extraneous instance of that class that you
have added to the top level of the nib. This instance is not tied to
any window, will never be displayed (unless you put it into a window
programmatically) and will serve you no purpose. The reason the slider
and color well still show up is because they are still there, in the
window. Hence all your outlets and whatnot should go to the ones in
the window, not anything in the MainMenu.nib window."
On Friday, September 14, 2001, at 08:28 PM, Lamar Williams wrote:
I only have 1 copy of each nib file. It's looks like DotView.m is
creating
it's own instance of the DotView class and MainMenu.nib is creating it's
own instance of the DotView class.
Has anyone seen this before?
On Friday, September 14, 2001, at 07:13 PM, David Rehring wrote:
Hello,
Can someone tell me why the address of "self" is different in
different
functions in the DotView class? A printout of the value of self from
diffrent functions is shown below.
------------------------------------------------------------------------------
-------
Sep 14 17:53:23 Dot View[1027] initWithFram self = 0x18d2020
Sep 14 17:53:23 Dot View[1027] initWithFram self = 0x18d4860
Sep 14 17:53:23 Dot View[1027] awakeFromNib self = 0x18d2020
Sep 14 17:53:23 Dot View[1027] awakeFromNib self = 0x18d4860
Sep 14 17:53:23 Dot View[1027] isOpaque self = 0x18d2020
Sep 14 17:53:23 Dot View[1027] isOpaque self = 0x18d2020
Sep 14 17:53:23 Dot View[1027] isOpaque self = 0x18d2020
Sep 14 17:53:23 Dot View[1027] drawRect self = 0x18d2020
Sep 14 17:53:26 Dot View[1027] setRadius self = 0x18d4860
Sep 14 17:53:26 Dot View[1027] setRadius self = 0x18d4860
Sep 14 17:53:26 Dot View[1027] setRadius self = 0x18d4860
Sep 14 17:53:26 Dot View[1027] setRadius self = 0x18d4860
Sep 14 17:53:26 Dot View[1027] setRadius self = 0x18d4860
Sep 14 17:53:26 Dot View[1027] setRadius self = 0x18d4860
Sep 14 17:53:26 Dot View[1027] setRadius self = 0x18d4860
Sep 14 17:53:28 Dot View[1027] mouseUp self = 0x18d2020
Sep 14 17:53:28 Dot View[1027] isOpaque self = 0x18d2020
Sep 14 17:53:28 Dot View[1027] drawRect self = 0x18d2020
------------------------------------------------------------------------------
----
The real question is why are there 2 instances of the DotView class?
It would appear you have two copies of it in your 'nib' file.
Could it be that you've dragged one copy into a 'window' for placement
purposes, and you've dragged a second copy to the 'nib' window? This
would
result in two copies being created.
Later,
--
David Rehring Psychos do not explode when light hits
Senior Software Engineer them, no matter how crazy they are...
Atimi Software, Inc.
www.atimi.com And totally insane guy!
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev