Reputation: 7778
I have a "Today" button to reset a datePicker to today's date. This works for the current month, but not for other months.
The method is:
- (IBAction)setToday:(id)sender
{
NSLog(@"%s", __FUNCTION__);
[datePicker setDateValue:[NSDate date]];
[datePicker setNeedsDisplay: YES];
}
What am I doing wrong?
Upvotes: 0
Views: 811
Reputation: 18855
I'm assuming your date picker is a property, in which case you should use the self keyword.
self.datePicker.date = [NSDate date];
Upvotes: 3