title: UIDatePicker Event Changed
body: <p>I write a simple iOS app just for learning, in my case I need to use a <code>UIDatePicker</code> and, after the user change the date, I need to write this date to an <code>UITextField</code>, here's the code:</p>
  
  <p>.h File</p>
  
  <pre><code>@interface ExpenseViewController: UIViewController&lt;UITextFieldDelegate&gt;
  
  @property (strong,nonatomic) IBOutlet UITextField *editTextDate;
  
  - (void) updateTextFieldDate:(UIDatePicker *)pickerL;
  
  @end
  </code></pre>
  
  <p>.m</p>
  
  <pre><code>@implementation ExpenseViewController
  
  @synthesize ediTextDate;
  
  - (void) viewDidLoad
  {
      [super viewDidLoad]
      UIDatePicker *datePicker;
      datePicker = [[UIDatePicker alloc]init];
      [datePicker setDate:[NSDate date]];
      [datePicker setDatePickerMode:UIDatePickerModeDate];
      [datePicker removeTarget:self action:nil forControlEvents:UIControlEventValueChanged];
      [datePicker addTarget:self action:@selector(updateTextFieldDate:)     forControlEvents:UIControlEventValueChanged];
      [editTextDate setInputView:datePicker];
  
  }
  
  - (void) updateTextFieldDate:(UIDatePicker *)pickerL{
      UIDatePicker *picker=(UIDatePicker*)self.editTextdate.inputView;
      editTextDate.text=[NSString stringWithFormat:@"%@",picker.date];
  }
  @end
  </code></pre>
  
  <p>But I'm getting this error: </p>
  
  <pre><code>ExpenseViewController updateTextFieldDate:]:unrecognized selector sent to instance 0x8d395f0
  </code></pre>
  
  <p>Can anyone help me?</p>
  
  <p>Thanks.</p>