Re: Treating several controls as an array (...or something)
Re: Treating several controls as an array (...or something)
- Subject: Re: Treating several controls as an array (...or something)
- From: Brian Webster <email@hidden>
- Date: Wed, 31 Jul 2002 11:08:07 -0500
On Wednesday, July 31, 2002, at 09:15 AM, cocoa-dev-
email@hidden wrote:
I was curious as to whether or not I could link several controls to one
Outlet in IB, and then refer to them with by that outlet and an
index or
some other reference. I have four static text fields and four buttons
(though this number may grow) -- each button is connected to the same
action, and I was wondering if there was any way to use the sender
parameter in the action message to get a reference to its accompanying
field. Brute force would work of course, I'm just looking for something
more elegant and requiring less conditional code.
In this type of situation, I usually shove the views into an
NSArray. I seem to remember someone releasing an IB Palette
that would let you instantiate collection objects in your nib
file and hook them up to a bunch of outlets. You might try
searching the archives for it (can't remember the name, tho).
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
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.