Re: is protected broken, or am I?
Re: is protected broken, or am I?
- Subject: Re: is protected broken, or am I?
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 10 Oct 2002 18:20:42 -0400
on 02-10-10 5:24 PM, matt neuburg at email@hidden wrote:
>
But on other occasions when this window appears it behaves quite a different
>
way. I don't want to put the code for this alternate behavior into MyClass.
>
I'd like to put it into some other class and have an instance of that other
>
class step into MyClass's coat, as it were, taking on all the outlets, and
>
being pointed to by all the window stuff, that the MyClass instance already is
>
set up with in the nib.
>
>
This is why I thought of a subclass of MyClass.
Why doesn't an instance of the subclass load (a copy of) the same nib,
making itself the file's owner in the process? The nib will be unarchived
into the instance of the subclass, and all the nib's outlets, actions, and
connections will be wired up to the (protected, and therefore accessible)
iVars (in that very instance) that the subclass inherits from its super.
In trying to access iVars in a separate instance of the superclass, you're
talking to a stranger. It's much more productive for a subclass to talk to
itself -- that is, to the parent in itself.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
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.