views:

89

answers:

1

hi, i'm having one text field, normally when touch the text field, keyboard will appear, is it any possibilities where when text field is touch one drop down list will appear to recommend value to be enter and value is selected it will appear in texr field

thanks

A: 

There's no automatic way of doing it but it is possible.

You would use the textFieldDidBeginEditing: delegate method of the UITextField to display a UIPickerView to your view. (You could also use textFieldShouldBeginEditing: depending on what you wanted to do.) When a user selected an item in the picker, you would add code to copy the appropriate text to the text field and, presumably, hide or delete the picker. You'd also need to hide or delete the picker when the text field lost focus.

Stephen Darlington
thanks, i did with textFieldDidBeginEditing, but get exception as below*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[AddPhotoViewController textFieldDidBeginEditing]: unrecognized selector sent to instance 0x190e60'if you don't mine can you tell me the stepsthanks
Apache
You're probably sending a message to the wrong object. See: http://stackoverflow.com/questions/1533019/how-to-fix-unrecognized-selector-sent-to-instance
Stephen Darlington