• 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: access multiple NSTextFields as an array?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: access multiple NSTextFields as an array?


  • Subject: Re: access multiple NSTextFields as an array?
  • From: "Eric E. Dolecki" <email@hidden>
  • Date: Mon, 20 Dec 2010 10:42:28 -0500

Use .tag and set it to i.


  Google Voice: (508) 656-0622
  Twitter: eric_dolecki      XBoxLive: edolecki      PSN: eric_dolecki
  http://blog.ericd.net



On Mon, Dec 20, 2010 at 10:38 AM, Artemiy Pavlov
<email@hidden>wrote:

> Hi all!
>
> I have a row of number labels that I create like so:
>
> for(i=1;i<=16;i++){
>    NSTextField *NumberLabel = [[NSTextField alloc]
> initWithFrame:NSMakeRect(...)];       ....
>   [NumberLabel setStringValue:[NSString stringWithFormat:@"%d", i]];
>   [self addSubview:PatternStepLabel];
> }
>
> The end result looks like attached in the screenshot.
>
> Now, I'd like to be able to access each one of these NSTextField objects to
> change their color. My question is, right in this loop, can I create some
> sort of an array of pointers to these objects?
>
> Or am limited to creating each object separately, i.e. NumberLabel1,
> NumberLabel2 and so on?
>
>
> Thanks and best wishes,
>
> Artemiy.
>
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >access multiple NSTextFields as an array? (From: Artemiy Pavlov <email@hidden>)

  • Prev by Date: Re: NSTextField: text appears aliased
  • Next by Date: Re: access multiple NSTextFields as an array?
  • Previous by thread: access multiple NSTextFields as an array?
  • Next by thread: Re: access multiple NSTextFields as an array?
  • Index(es):
    • Date
    • Thread