if those are the only views you can use

[ self subviews ]

to get an array of them in the order they are currently stacked. 

On 20-Dec-2010, at 11:38 PM, Artemiy Pavlov 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.
> 
> <Picture 1.png>
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/rols%40rols.org
> 
> This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to