Re: Toplevel Objects in NIB files
Re: Toplevel Objects in NIB files
On Tue, Apr 02, 2002 at 08:26:52PM -0500, Sherm Pendley wrote:
>
FWIW, I don't recall seeing any really good documentation about this -
>
and I looked hard, because it's very important for supporting
>
dynamically-loaded NIBs within a language bridge. I figured it out for
>
CamelBones by coding my proxy class to report the name of each method
>
asked for with "respondsToSelector:", and then noticed that a call to
>
"setWhatever:" got generated for each outlet I wired up in my NIBs.
The behavior you're seeing - where a method is used, then if it
doesn't respond, an instance variable is used - is the result of
key-value coding.
<
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/Foundation/ObjC_classic/Protocols/NSKeyValueCoding.html>
Even if NSNibOutletConnector isn't using take[StoredValue:forKey:, the
resulting behavior is similar.
I've been caught by this a number of times when I happened to have
implemented a setXXX method and was confused why an outlet wasn't
being hooked up! Key-value coding is very flexible, and I use it a
lot especially when reading/writing data.
--
=Nicholas Riley <email@hidden> | <
http://www.uiuc.edu/ph/www/njriley>
Pablo Research Group, Department of Computer Science and
Medical Scholars Program, University of Illinois at Urbana-Champaign
_______________________________________________
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.