See the - (void)setRepresentedObject:(id)anObject method of NSCell.  You can 
set a string or dictionary and the represented object and retrieve it via 
-representedObject.
 
You can also instantiate an array and add objects to the array within IB.  Then 
you only need an outlet instance variable to reference the array and not 
separate instance variables for all of the user interface objects.  See 
"Foundation Collections Palette"  You can populate the array  entirely within 
IB. Make any target/action connections in IB.
http://www.geocities.com/kritter_cocoadev/

 
For some final advice: Don't do what you are contemplating.  Users hate 
interfaces that change outside the user's control.  If a group of objects are 
going to appear or disappear, consider whether they should become enabled or 
disabled instead.  If objects are logically associated, group the objects 
together visibly in boxes or matrix or tabs or through other means.  Then you 
can enable or disable all elements of the box in code without needing to have 
outlets for every element.  You can even hide or unhidden the whole box.
 
use 
[[myBox subviews] makeObjectPerformSelector:@selector(setEnabled:) 
withObject:NO];
 
or similar.
 
 
_______________________________________________

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