0

I have implemented a UIDatePicker IOS7 View into a static tableview with the help of - iOS 7 - How to display a date picker in place in a table view?

All works great- my only issue now is how to display the result in my UITextField once a date has been selected? Sounds like it should be a simple thing - but as its a static field I'm not sure how to access the date property once a selection is made or which method to apply the code to!?

Community
  • 1
  • 1
Dancer
  • 17,035
  • 38
  • 129
  • 206

1 Answers1

0

A good pattern to follow would be sending the date selected in the UIDatePicker back to the UIViewController that is handling the UITableView via delegation. This can be done by assigning an IBAction to the valueChanged: control event of the date picker.

Once you have obtained the NSDate, you can transform it into text with the format of your choosing using an NSDateFormatter

Stavash
  • 14,244
  • 5
  • 52
  • 80