I just add one NSDatePicker to the form, set the style graphical, and set the action like this:
[datePicker setAction:@selector(datePickSelected:)];
in the method, it just prints out the selected date.
-(void)datePickSelected:(id)sender
{
NSLog(@"%@",[datePicker dateValue]);
}
It works, but runs two times when you click the date in this datepicker. 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