Re: Newbie question
Re: Newbie question
- Subject: Re: Newbie question
- From: Don Arbow <email@hidden>
- Date: Thu, 13 Mar 2003 10:29:38 -0800
On Thursday, March 13, 2003, at 08:35 AM, James Mooney wrote:
In this example, you are not supposed to instantiate the class
Dotview. When you do, the problem above occurs. When you delete the
instatiaion in the interface builder, everything works fine. The
slider changes the size of the shape and the colorwell works fine. It
wasn't until I downloaded the complete project from the publishers
website that I saw there was no little Dotview icon. I immediately
saw what I was doing wrong. However, I do not understand how
instantiating in the interface builder effects the operation of my
project. All examples I have seen so far told you to instantiate the
class and then write the classes to the project. In this case.....you
are only supposed to do the later. The Dotview.h and .m files were
created.
What does instantiating a class do when you tell it to be done in the
interface builder? Whether you do it or not, the slider and the
colorwell gets drawn. If I instantiate the Dotview class, the
communication of the slider and the NSView do not work, not
instantiating and they talk to each other? There is no change in the
code in the .m or .h files so I assume there is some plist or xml doc
the app uses where info is added or subtracted when you instruct a
class to be instantiated. Anyone know the reason why? What is going
on?
The reason that you do not need to instantiate the DotView is because
it is already instantiated for you. If you recall when you built the
window in IB, you dragged a CustomView object into the window, then set
it via the Custom Class panel to DotView.
Most of the time, you'll be instantiating controller classes, which
don't have a visual representation, like window widgets do. Things you
drag off the palettes are visual items and are instantiated by
awakeFromNib when the nib is loaded.
Don
_______________________________________________
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.