创建时间选择器
datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 100, Main_Screen_Width , Main_Screen_Width / 2.0)];
datePicker.datePickerMode = UIDatePickerModeDate;
datePicker.minuteInterval = 5;
NSDate *minDate = [[NSDate alloc] initWithTimeIntervalSinceNow:0];
最小时间 最大时间
datePicker.minimumDate = minDate;
[self.view addSubview:datePicker];
datePicker.hidden = YES;
添加变化的方法
[datePicker addTarget:self action:@selector(dateChanged:) forControlEvents:UIControlEventValueChanged ];