From: http://www.nevpro.co.in/blogs/entry/13-dropdown-in-iphone-using-uitextfieldpickerview-or-datepickerview.html
In Iphone xcode we do not have the Dropdown/select object that we can drag into our
Interface builder.Also if we use the UIPicker/UIDatepicker then it occupies more
space on iPhone screen. So there is alternate solution we have that when we start
editing the text of UITextField there will be pop-up occures of PickerView.
So in this blog we are going to see how to generate dropdown/select in xcode in iphone
in few steps.
Step 1: Open the xcode, create new application using View Base Application and name
it as 'GetDropdown'.
Step 2: Choose your interface builder. Here i selected Window ('Dropdown.xib').Now
you will see xcode automatically creates properly the directiory structure for you.
Step 3: Add two UITextFields one is for Simple PickerView and another is for DatePickerView
and add UIPickerView, UIDatePickerView on Interface Builder.
Step 4: Add new ViewController and Name it as 'popViewController' or if you have already
then go to step no.5
Step 5: Now select 'popViewController.h' add the following code:
Step 6:Now select 'popViewController.m' add the following code:
Step 7:Now Inspect the IBOutlet of your 'pop-ViewController.h' with your corresponding objects.
As you two add IBAction in your 'pop-ViewController.h' then inspect those IBAction with
corresponding UITextField's 'event property 'Editing Did Begin'.
Step 8:Now your application is done. So start compiling the applicaton. and run it.
You will get the following screen.