I simply add one NSDatePicker to the form, set the style to graphic, and set the action as follows:
[datePicker setAction:@selector(datePickSelected:)]
in the method, it just prints the selected date.
-(void)datePickSelected:(id)sender
{
NSLog(@"%@",[datePicker dateValue]);
}
It works, but is executed twice when you click the date in this datepicker parameter. Why is this?
2011-05-25 15:17:09.382 xxx[6609:a0f] 2011-05-13 15:17:04 +0800
2011-05-25 15:17:09.677 xxx[6609:a0f] 2011-05-13 15:17:04 +0800
source
share