我制作了一个带有 textview 的应用程序,当你点击它时,会出现一个日期选择器。我的代码有问题吗?
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(112, 88, 97, 30)];
textField.borderStyle = UITextBorderStyleRoundedRect;
textField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
[self.view addSubview:textField];
UIDatePicker *datePicker = [[UIDatePicker alloc] init];
datePicker.datePickerMode = UIDatePickerModeDate;
[datePicker addTarget:self action:@selector(datePickerValueChanged:) forControlEvents:UIControlEventValueChanged];
[textField setInputView:datePicker];
我收到错误2013-08-04 20:38:54.249 Habit Pal[7252:c07] -[SleepModeViewController datePickerValueChanged:]: unrecognized selector sent to instance 0x8840d70