Article View: comp.sys.next.programmer
Article #405Re: how do outlets work?
From: Gregory H. Anderson
Date: Sat, 01 Aug 1992 19:51
Date: Sat, 01 Aug 1992 19:51
57 lines
2825 bytes
2825 bytes
In article <1992Jul29.191912.206@digifix!uunet.ca> sanguish@digifix.com
(Scott Anguish) writes:
> That brings up a question that I have about outlets...
>
> In the preliminary 1.0 documentation interface builder also
> generated methods that would initialize these like
>
> - setOutlet1:sender
> {
> [ some method call I can't remember ]
> return self;
> }
>
> Is this still supported? I can't find it anywhere in the current
> documentation.
>
> If it is still supported, and is pretty certain to be supported in
> the future, I have a few places i could really use this.
It is still supported. Here's a clip from the 2.0RelNotes:
------------------------------------------------------------------------
In earlier releases, you had to provide a method to set each outlet that
you declared in a new class. For example, if your subclass had an outlet
named myOutlet, the source code for your subclass had to declare and
implement this method:
- setMyOutlet:anObject
{
myOutlet = anObject;
return self;
}
The Unparse item in the Class's window would create these "set" methods
automatically.
These outlet initialization methods are no longer required. At run time,
when objects are being unarchived and initialized, the system will send a
message to an object to set its outlet, assuming the object can respond to
such a message. If not, the system sets the object's outlet directly.
This change reduces the clutter in your source code and is completely
compatible with earlier releases. The Unparse item in the Class's window
no longer creates these "set" methods; however, you can still implement
them in your source code if you want. This is sometimes useful if you
need to do additional initialization within the "set" method before the
application begins receiving events.
If you have an application built with the 1.0 version of Interface Builder
and plan to recompile it using the 2.0 release, you can delete these
outlet initialization methods from your class interface and implementation
files.
------------------------------------------------------------------------
--
Gregory H. Anderson | "We're very tolerant around here,
Benevolent Dictator-for-Life | being only amateurs ourselves."
Anderson Financial Systems | - Tortoise (Godel, Escher, Bach)
greg@afs.com (Nextmail OK) |
Technical Details
Message-ID:
<1992Aug1.195119.778@afs.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!usc!rpi!psinntp!psinntp!afs!gregReferences:
<1992Jul29.191912.206@digifix!uunet.ca>Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!usc!rpi!psinntp!psinntp!afs!greg From: greg@afs.com (Gregory H. Anderson) Subject: Re: how do outlets work? Message-ID: <1992Aug1.195119.778@afs.com> Sender: greg@afs.com Reply-To: greg@afs.com References: <1992Jul29.191912.206@digifix!uunet.ca> Distribution: usa Date: Sat, 1 Aug 1992 19:51:19 GMT Lines: 57