You must use the inputView property of your UITextField to make it a UITextField instead of a keyboard. iOS6 will take care of everything for you (featuring a compiler with animations instead of keyboards, etc.).
Note. You probably want to add some more inputAccessoryView (usually a UIToolBar with some OK button) so that the user can remove the collector (your OK's IBAction will just call [textField resignFirstResponder] to happen, of course), since UIDatePicker doesn't have a button to confirm the entry (whereas the keyboard has its own "Return Key")
source share