Re: NSView Names
Re: NSView Names
- Subject: Re: NSView Names
- From: Graeme Hiebert <email@hidden>
- Date: Wed, 27 Feb 2002 18:47:06 -0800
On Wednesday, February 27, 2002, at 03:44 PM, Andy Lee wrote:
Here's a lazy man's approach to setting up an NSDictionary without
modifying IB. Create a non-displaying window, and put an NSMatrix of
text cells into it. The matrix should have two columns and as many
rows as you want to have dictionary entries. Type the object names
into the left column. Connect the cells of the second column to the
objects you want to name, using the "target" outlet. Create and
instantiate a class which has an outlet pointing to the matrix. In
this class, have an -awakeFromNib method that traverses the matrix and
builds up the NSDictionary.
I like this solution (and may even use it -- or rather, the one-column
version -- myself sometime), but there is another way. You can always
assign a name through the AppleScript properties, and use AppleScript
calls to work with the name.
I think the NSMatrix/NSDictionary is probably easier, though.
-g
_______________________________________________
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.