dpsthree
dpsthree

Reputation: 2285

Methods for obtaining user input on iPhone

I'm working on an iPhone app and would like to have a simple text input box pop up when a user clicks my custom search button. My problem is that I'm not sure what approaches are available for achieving this. Googling results in search overload and I am presented with so many views that I'm not sure what is standard and what isn't. The information I am requesting from the user is a single zip code so I would like to avoid creating a whole new view for this if possible. I am still new to working in Xcode so please take it easy on me.

Edit: The dialog box that iTunes uses to ask for your password would be ideal. What is that called?

Upvotes: 0

Views: 2938

Answers (2)

JordanC
JordanC

Reputation: 1323

Use

[alert setAlertViewStyle:UIAlertViewStylePlainTextInput];

or

[alert setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];

Hope it helps! Best of luck

Upvotes: 2

vincent
vincent

Reputation: 441

Well, you could use a UIAlertView including a UITextView.

Honestly, I'm not sure Apple will like it, because UIAlertView should only prompt message to inform the user, but it's at least kinda cool ;)

You can find a tutorial on this website : http://iphonedevelopment.blogspot.com/2009/02/alert-view-with-prompt.html

Upvotes: 2

Related Questions