title: uidatepicker [__NSDate date]: unrecognized selector sent to instance
body: <p>I am using uidatepicker and throwing exception when I try to get the date from date picker. </p>
  
  <p>.h file:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @protocol TimeDelegate &lt;NSObject&gt;
  - (void)returnTime:(NSDate *)item;
  
  @end
  
  @interface TimeController : UIViewController &lt;UIPickerViewDelegate&gt;
  {
      UIDatePicker *timePicker;
  }
  @property (nonatomic, weak) id &lt;TimeDelegate&gt; delegate;
  @property (nonatomic, retain) IBOutlet UIDatePicker *timePicker;
  @property (nonatomic, retain) NSDate *activityTime;
  @end
  </code></pre>
  
  <p>.m file</p>
  
  <pre><code>#import "TimeController.h"
  
  
  
  @implementation TimeController
  
  @synthesize timePicker;
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view.
      self.timePicker  = [NSDate date];
  
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  -(void) viewDidDisappear:(BOOL)animated
  {
      NSLog(@"%@", self.activityTime);
      //NSDate *itemToPassBack = [self.timePicker date];
      [self.delegate returnTime:self.activityTime];
  }
  
  
  - (IBAction)SelectTime:(id)sender {
      self.activityTime = [timePicker date];
  }
  
  @end
  </code></pre>
  
  <p>The error happens when I click select or navigate back. Initially I thought the date picker is not available during viewdiddisappear and exception is thrown. The select button also behave the same and that made me skeptical that there is something else is wrong.</p>