So I'm having a problem with a NSDatePicker.
Basically, when using this code from the protocol, it takes "two clicks" for the date to actually change in the control.
Basically, on the first "click" on a new date, it prints the new date and the old date (once from the datePickerCell override and once from the loadSchedule method). On the second click, it prints the new date twice.
About the only other solution I could think of would be to assign the proposedDate to a separate date field, and reading from that one instead of straight from the control itself. That honestly seems a little nutty and unnecessary though.
Basically, when using this code from the protocol, it takes "two clicks" for the date to actually change in the control.
Code:
- (void)loadSchedule {
NSLog(@"Date is %@",[datePicker dateValue]);
}
- (void)datePickerCell:(NSDatePickerCell *)aDatePickerCell validateProposedDateValue:(NSDate **)proposedDateValue timeInterval:(NSTimeInterval *)proposedTimeInterval {
NSLog(@"PDate: %@",*proposedDateValue);
[self loadSchedule];
}
Basically, on the first "click" on a new date, it prints the new date and the old date (once from the datePickerCell override and once from the loadSchedule method). On the second click, it prints the new date twice.
About the only other solution I could think of would be to assign the proposedDate to a separate date field, and reading from that one instead of straight from the control itself. That honestly seems a little nutty and unnecessary though.