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!
flipsideViewController.datePicker.datemay not exist by the time you go back tomainViewController. You need to set it before you release or return from theFlipViewControllerview.