title: Xcode Saving UIDatepicker to be displayed in a label
body: <p>The following code is to show my UIDatepicker: </p>
  
  <pre><code>- (IBAction)showActionSheet:(id)sender {
      NSString *title = UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"\n\n\n\n\n\n\n\n\n" : @"\n\n\n\n\n\n\n\n\n\n\n\n" ;
      UIActionSheet *actionSheet = [[UIActionSheet alloc] 
                                    initWithTitle:[NSString stringWithFormat:@"%@%@", title, NSLocalizedString(@"Please Select A Date", @"")]
                                    delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"I've Made My Choice", nil];
      [actionSheet showInView:self.view];
      UIDatePicker *datePicker = [[[UIDatePicker alloc] init] autorelease];
      datePicker.datePickerMode = UIDatePickerModeDate;
      [actionSheet addSubview:datePicker];
  }
  </code></pre>
  
  <p>It all works properly, but what I'd like to do is to display the users choice into a label which I have named " label1 ". Can anyone help? Thanks! </p>
  
  <p>UPDATE:</p>
  
  <p>Here is the updated code:</p>
  
  <pre><code>- (IBAction)showActionSheet:(id)sender {
  NSString *title = UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation) ? @"\n\n\n\n\n\n\n\n\n" : @"\n\n\n\n\n\n\n\n\n\n\n\n" ;
  UIActionSheet *actionSheet = [[UIActionSheet alloc] 
                                initWithTitle:[NSString stringWithFormat:@"%@%@", title, NSLocalizedString(@"Please Select A Date", @"")]
                                delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:@"I've Made My Choice", nil];
  [actionSheet showInView:self.view];
  UIDatePicker *datePicker = [[[UIDatePicker alloc] init] autorelease];
  datePicker.datePickerMode = UIDatePickerModeDate;
  [actionSheet addSubview:datePicker];
  [datePicker addTarget:self
                 action:@selector(updateLabel:)
       forControlEvents:UIControlEventValueChanged];  
  </code></pre>
  
  <p>}</p>
  
  <pre><code>- (void)updateLabel:(id)sender {
  NSDateFormatter *df = [[NSDateFormatter alloc] init];
  df.dateStyle = NSDateFormatterMediumStyle;
  label1.text = [NSString stringWithFormat:@"%@",[df stringFromDate:datePicker.date]];
  [df release];
  
  
  /* the following allows you to choose the date components
   NSCalendar *calendar = [NSCalendar currentCalendar];
  
   int hour   =    [[calendar components:NSHourCalendarUnit    fromDate:[datePicker date]] hour];
   int minute =    [[calendar components:NSMinuteCalendarUnit  fromDate:[datePicker date]] minute];
  
   int year   =    [[calendar components:NSYearCalendarUnit    fromDate:[datePicker date]] year];
   int month  =    [[calendar components:NSMonthCalendarUnit   fromDate:[datePicker date]] month];
   int day    =    [[calendar components:NSDayCalendarUnit     fromDate:[datePicker date]] day];
   */
  </code></pre>
  
  <p>}<br>
   That's for the .m , my .xib has the 'label' tied properly too :) just getting a (null) value whenever I choose my date :(</p>