title: Reactive Cocoa enable button based on text in UITextField
body: <p>I'm having an issue with some really simple code in Reactive Cocoa and I can't understand what I'm doing wrong. </p>
  
  <p>I'm simply trying to bind the enabled state of a UIButton to a signal. That signal takes the text of a <code>UITextField</code> and runs it through a regex. This way I can enable the button when the regex matches.</p>
  
  <p>This code gives me an exception while loading the View Controller:</p>
  
  <pre><code>// Poperties used in the view controller
  @property (strong, nonatomic) NSRegularExpression *regex;
  @property (weak, nonatomic) IBOutlet UITextField *myTextField;
  @property (weak, nonatomic) IBOutlet UIButton *continueButton;
  
  // ... other stuff ...
  
  // Code in my "view did load" method
  RACSignal *mySignal = RACObserve(self, myTextField);
  
  [mySignal deliverOn:[RACScheduler mainThreadScheduler]];
  
  @weakify(self);
  [mySignal map:^(NSString *value) {
      @strongify(self);
      NSUInteger matches = [self.regex numberOfMatchesInString:value
                                                       options:0
                                                       range:NSMakeRange(0, [value length])];
      return @(matches &gt; 0);
  }];
  
  RAC(self.continueButton, enabled) = mySignal;
  </code></pre>
  
  <p>Clearly the exception explains that I'm trying to get the selector "enabled" from a <code>UITextField</code>, and the <code>UITextField</code> does not have this selector. I don't understand why I'm getting this error when I'm calling the enabled selector in my <code>continueButton</code>, not <code>myTextField</code>.</p>
  
  <p>Basically the exception is:</p>
  
  <pre><code>[UITextField charValue]: unrecognized selector sent to instance 0xa2c7830
  </code></pre>
  
  <p>And the debugger stops in the line:</p>
  
  <pre><code>[object setValue:x ?: nilValue forKeyPath:keyPath];
  </code></pre>
  
  <p>Instance <code>0xa2c7830</code> is a <code>UITextField</code>. <code>object</code> is a <code>UIButton</code> and <code>keyPath</code> is <code>@"enabled"</code>. I just don't see anything wrong with this setup, except that its being called on my <code>UITextField</code> instead of <code>UIButton</code>!</p>
  
  <p>Thanks for your help!</p>