Can I then access each element via array[0], array[1] etc.? I.e. will [array[0] setColor:...] work?

No! This is not a C array, it's an object. Use -objectAtIndex instead I.e. [[array objectAtIndex:0] setColor:…]

Check documentation for NSArray and NSMutableArray for more info, it's your friend! :-)

Yes, I did this after sending this e-mail :-) Weird though, that it doesn't work straight away... Here is my code:

int x;
NSMutableArray *Array;

for(x=1;x<=9;x++){
    NSTextField *PatternRateLabel = etc. etc.
    [Array addObject:PatternRateLabel];
}

[[Array objectAtIndex:0] setColor:...]

However, if I have this last line, my view freezes... Maybe I do not create the array properly?


All the best,

Artemiy._______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to