Re: Enumerating outlets automatically?
Re: Enumerating outlets automatically?
- Subject: Re: Enumerating outlets automatically?
- From: David Duncan <email@hidden>
- Date: Wed, 5 Nov 2008 21:26:35 -0800
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 (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