开发者

date selected from datepicker

Sir,i wa开发者_StackOverflow社区nt to pass the selected date from datepicker to the textbox. Can anyone help me? Thanks in advance!


You need to get the date selected in the DatePicker, format it, and write it out:

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"MMMM d, yyyy"]; NSDate *pickedDate = [datePicker date]; customDate.text = [dateFormatter stringFromDate:pickedDate]; [dateFormatter release];

Apple has a doc on different date formatters.

You can trigger the change by hooking into the valueChanged event of the DatePicker

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜