Observing change in UIDatePicker
You need to add to your UIDatePicker the UIControlEventValueChanged
event to handle date changes:
[myDatePicker addTarget:self action:@selector(dateIsChanged:) forControlEvents:UIControlEventValueChanged];
Then the implementation:
- (void)dateIsChanged:(id)sender{
NSLog(@"Date changed");
}
Go to IB and drag from the UIDatePicker
to your .h file. Then select
Handle this however you want in your .m file; XCode will add the method below for you.