title: disabling rows on condition on xlform
body: <p>I have a section set up using xlform where there is a bool field and then a text field under it. I want to disable the text field if the bool is chosen. I tried with the following, but it did not work</p>
  
  <pre><code>if ([[self.form valueForKey:@"pay"] isEqualToValue:@(1)]){
      row.disabled = YES;
  } else {
      row.required = YES;
  }
  [section addFormRow:row];
  </code></pre>
  
  <p>Any suggestions? <a href="http://cocoadocs.org/docsets/XLForm/2.1.0/" rel="nofollow">Here is</a> the documentation, spent a bunch of time search without being able to find the answer.</p>
  
  <p><strong>Edit:</strong> I'm starting to think that the values of the dictionary don't get updated dynamically. Which is odd because the dictionary can be accessed in other parts of the view controller at any time.</p>
  
  <p><strong>Edit</strong> </p>
  
  <pre><code>- (void)formRowDescriptorValueHasChangedTwo:(XLFormRowDescriptor *)formRow value:(id)value
  {
  [value isEqual:[self.formValues valueForKey:@"pay"]];
  
  if([formRow.tag isEqualToString:@"pay"] &amp;&amp; [value isEqual:[NSNumber numberWithBool:YES]])
  {
      self.price.disabled = NO;
      self.price.required = YES;
      [self.tableView reloadRowsAtIndexPaths:@[[self.form indexPathOfFormRow:self.price]]
                            withRowAnimation:UITableViewRowAnimationNone];
  }
  }
  </code></pre>
  
  <p>I got it working, but I have a new problem. </p>
  
  <p>Here is the code
      - (void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)formRow oldValue:(id)oldValue newValue:(id)newValue
  {</p>
  
  <pre><code>if([formRow.tag isEqualToString:@"now"] &amp;&amp; [newValue isEqual:[NSNumber numberWithBool:YES]])
  {
      self.time.disabled = YES;
      [self.tableView reloadRowsAtIndexPaths:@[[self.form indexPathOfFormRow:self.time]]
                            withRowAnimation:UITableViewRowAnimationAutomatic];
  }
  
  
  
      if([formRow.tag isEqualToString:@"pay"] &amp;&amp; [newValue isEqual:[NSNumber numberWithBool:YES]])
  {
      self.price.disabled = NO;
      self.price.required = YES;
      [self.tableView reloadRowsAtIndexPaths:@[[self.form indexPathOfFormRow:self.price]]
                            withRowAnimation:UITableViewRowAnimationAutomatic];
  }
  
  
  
  
  }
  </code></pre>
  
  <p>When I click on the first row (now), it disables the corresponding row fine, but when I click on the second row (pay), it makes the row that now disables reappear AND it makes the row that I want to appear under pay to disappear.</p>
  
  <p><strong>Edit</strong> Got it to work by changing the animation to UITableViewRowAnimationNone</p>