How to use -optionDescriptionsForBinding: ?
How to use -optionDescriptionsForBinding: ?
- Subject: How to use -optionDescriptionsForBinding: ?
- From: Pierre Molinaro <email@hidden>
- Date: Thu, 30 Apr 2009 14:26:13 +0200
Hi,
I am trying to programmatically enumerate all available bindings and
their options for a given class. It works fine, except -
optionDescriptionsForBinding: that allways returns an empty array of
options, for any binding.
The routine I have written is:
static void enumerateBindingsForClass (Class inClass) {
NSObject * object = [inClass new] ;
NSLog (@"Bindings for '%@' class:", [object className]) ;
NSArray * exposedBindings = [object exposedBindings] ;
for (NSUInteger i=0 ; i<[exposedBindings count] ; i++) {
NSString * binding = [exposedBindings objectAtIndex:i] ;
NSArray * options = [object
optionDescriptionsForBinding:binding] ; // Allways returns an empty
array
NSLog (@" Binding '%@', class '%@', %u options %@", binding,
[object valueClassForBinding:binding], [options count], options) ;
}
[object release] ;
}
When I call it with [NSView class] argument, I get:
Bindings for 'NSView' class:
Binding 'hidden', class 'NSNumber', 0 options (
)
Binding 'toolTip', class 'NSString', 0 options (
)
Any ideas what I'm doing wrong?
Thanks,
Pierre
_______________________________________________
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