Hi all, I need to invoke a UIDatePicker when i tap on a textfield. usually when we tap on a textfield the keyboard pop ups. but i need a date picker instead of that. can anyone help me please...!
Thank you in advance.
Hi all, I need to invoke a UIDatePicker when i tap on a textfield. usually when we tap on a textfield the keyboard pop ups. but i need a date picker instead of that. can anyone help me please...!
Thank you in advance.
A textfield is a control you use for text input. This is why tapping on it the keyboard pops up. If you need a date picker, simply use directly a date picker if you have space in your view, otherwise use a button and set the target-action of the button so that it shows a new view containing your date picker.
UIDatePicker returns NSDdate. Use NSDateFormatter to get the string you want:
NSDateFormatter *format = [[NSDateFormatter alloc] init];
[format setDateFormat:@"yyyy-MM-dd"];
NSLog(@"%@", [format stringFromDate:newDate]);
Hi, I'm very new with iPhone development and I'm looking for the same thing for a little project. Shibin, could please send me a little project where you implement this functionnality? That will help me.. I thank you in advance. Stan