title: Upper and lower limit on UIDatePicker
body: <p>So a few weeks ago I asked for a tip on how to actually lock a specific range of dates on UIDatePicker, instead of just graying them. It worked fine.
  But now I've reached a similar situation, and can't get it to work. Now I have a minimum AND a maximum date, i.e., I only want to allow a small (or not) interval of dates.</p>
  
  <p>Here's what I'm trying to do: (I added a target on the datepicker)</p>
  
  <pre><code>-(void) disableDate {
  if ([datePicker.date compare:[NSDate date]] == NSOrderedDescending || [datePicker.date compare:datePicker.minimumDate] == NSOrderedAscending) {
      datePicker.date = [NSDate date];
      [datePicker reloadInputViews];
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Some notes:
  1) It's working only for the first time I change datepicker's date. The second time (and on) it just doesn't work anymore - datepicker won't scroll back to current date.
  2) Note 1) is happening for some reason I don't know, cause disableDate is being called, BUT the app NEVER goes into the "if", like the conditions I set are never being satisfied. </p>
  
  <p>In other words: I don't know why it's scrolling once since it never goes into the if statement, and I also don't know WHY it never goes into the if statement! </p>
  
  <p>Any ideas here?</p>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT: The minimum.date and maximum.date are set.</p>