title: how to send data from uiviewcontroller to uipopover when it is being launched?
body: <p>i am using a uidatepicker inside a uipopover in many viewcontrollers. I need to keep the picked date in each of these viewcontrollers different so I can load them back when uidatepicker is launched again in their respective VC's. How do I accomplish this?</p>
  
  <p>how to send data from uiViewController to uipopover so that the datepicker is set to corresponding VC's intial date. Help much appreciated.</p>
  
  <p>VC code which launches uipopover designed in storyboard:</p>
  
  <pre><code>- (IBAction)calendarbutton:(UIButton *)sender {
  
      UIView *anchor = sender;
      selectDatePopover *selectDatePopoverinstance =
      [self.storyboard instantiateViewControllerWithIdentifier:@"selectDatePopover"];
      _popover = [[UIPopoverController alloc]
             initWithContentViewController:selectDatePopoverinstance];
      [_popover presentPopoverFromRect:anchor.frame
                           inView:anchor.superview
         permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
  
      selectDatePopoverinstance.delegate = self;
      _popover.delegate =self;
  }
  </code></pre>
  
  <p>code in uipopover:</p>
  
  <pre><code>- (void)viewDidLoad
  {
      NSLog(@"viewdidload");
      NSUserDefaults *datepicks = [NSUserDefaults standardUserDefaults];
      NSString *myLastDate = [datepicks objectForKey:@"myLastDate"];
  
      if (myLastDate == nil) {
          [self.mydatepicker setDate:[NSDate date] animated:NO];
      } else {
           NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
           [formatter setDateStyle : NSDateFormatterLongStyle];
  
           [self.mydatepicker setDate:[formatter dateFromString:myLastDate] animated:NO];
      }
      [super viewDidLoad];
      NSLog(@"insideview");
  // Do any additional setup after loading the view.
  }
  </code></pre>