On Nov 5, 2008, at 9:13 PM, Graham Cox wrote:

Is there a way to enumerate the outlets of an object automatically?

In a certain type of controller object I'm finding I'm writing a lot of code like this:

[myOutlet1 setEnabled:NO];
[myOutlet2 setEnabled:NO];
... etc for another several dozen outlets ...

If I could get a list of outlets (maybe as a dictionary with the ivar name as key) I could probably find much easier ways to do stuff to each one. I suspect the answer is no but I thought I'd ask anyway...


If the 'enabled' state of all these objects are effectively tied to a particular state, then why not use bindings? You could bind the enabled state of these controls to a property of your controller object and then you just set the property and voila.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to