I have a question concerning a UIDatePicker:
[datePicker addTarget:self action:@selector(datePickerValueChange开发者_JAVA百科d:) forControlEvents:UIControlEventValueChanged];
This will call my method "datePickerValueChanged:" but only if, well, a value got changed. But how can I call that method if nothing on the UIDatePicker was changed?
When do you want to call the method? (or when do you want it to be called?)
If you keep a reference to your date picker object, you can always call the 'datePickerValueChanged' action method directly from within your controller object or any other object that has a reference to your controller object. You can also interrogate the date picker at any time if you have a handle to it, via its date property, to find out which date is showing.
精彩评论