Skip navigation.
 
mldynamically adding value transformer
FROM : David Alter
DATE : Tue Apr 03 22:57:33 2007

I'm dynamically creating some buttons and then settup their bindings. 
This is all working great. Now I have a button where I need to add a 
Value Transformer. It is my understanding this needs to be added as 
part of the options for the bind:toObject:withKeyPath:options: 
method. I'm unclear what needs to be in this options dictionary for 
this to work.

Here is what I was doing. If the "info" method returns nil I want 
"myButton" to be disabled. The code is listed below.


   NSDictionary * options = [NSDictionary 
dictionaryWithObject:NSValueTransformerNameBindingOption forKey: 
NSIsNotNilTransformerName];
   [myButton bind:@"enabled" toObject:self withKeyPath:@"info" 
options:options];

Thank you for the help
-dave

Related mailsAuthorDate
No related mails found.