views:

13

answers:

1

I'm sure I have something dumb wrong, but I'm trying to pass the data set in a UIDatePicker from one view to another (I'm using the Utility Template in Xcode).

I've written out all of the pertinent code below.


FlipsideViewController.h

@interface FlipsideViewController : UIViewController {
    IBOutlet UIDatePicker *datePicker;
}

@property(nonatomic, retain) IBOutlet UIDatePicker *datePicker;

FlipsideViewController.m

@synthesize datePicker;

mainViewController.m

NSDate *time = flipsideViewController.datePicker.date;

Logging time returns null.

Also, I'm positive I've properly linked datePicker to the UIDatePicker element in Interface Builder.

Thanks!

+1  A: 

flipsideViewController.datePicker.date may not exist by the time you go back to mainViewController. You need to set it before you release or return from the FlipViewController view.

Jason McCreary
Any tips on how to do that?
Ian Silber