• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Treating several controls as an array (...or something)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Treating several controls as an array (...or something)


  • Subject: Re: Treating several controls as an array (...or something)
  • From: Chris Ridd <email@hidden>
  • Date: Wed, 31 Jul 2002 15:32:12 +0100

David Newberry <email@hidden> wrote:
> Hello all,
>
> 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.
>
> Thanks a lot,
> -David Newberry

The normal way to achieve your goal is to set different tags (either via IB
or in code) on each control, and query the tag in your action.

Cheers,

Chris
_______________________________________________
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.

References: 
 >Treating several controls as an array (...or something) (From: David Newberry <email@hidden>)

  • Prev by Date: Re: Treating several controls as an array (...or something)
  • Next by Date: RE: Accessor methods and (auto)release <Memory trail>
  • Previous by thread: Re: Treating several controls as an array (...or something)
  • Next by thread: Re: Treating several controls as an array (...or something)
  • Index(es):
    • Date
    • Thread