I get very strange behavior in UIDatePicker. I have a view with a date picker declared in an .h file as IBOutlet UIDatePicker * datePicker; with non-atomic property and conservation. datePicker is correctly linked in IB file.
In the code, I set the minimum, maximum, start date and action to call UICOntrolEventValueChanged using the following code
If (!currentDate) {
initialDate = [NSDate date];
} else {
initialDate = currentdate;
}
[datePicker setMinimumDate:[NSDate date]];
[datePicker setMaximumDate:[[NSDate date] addTimeInterval:5 * 365.25 * 24 * 60 * 60]];
[datePicker setDate:initialDate animated:YES];
[datePicker addTarget:self action:@selector(getDatePickerValue:) forControlEvents:UIControlEventValueChanged];
In getDatePickerValue, I get a new date using datePicker.date.
When the view is closed (using the button made), I get the current date value using datePicker.date.
, currentDate, " ". , , pickerView. . ,
, , 9 2010 .
datePicker.date 10 2010 .
11 2010 . , .
NSLogs , .
( 3.0), .
, . , - .