Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-01-2009, 02:27 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 196
Default autocomplete textfield? or combox?

hi i have the next problem.. i need put in mi aplication an controller combox or downdrill or textfield for what user select a choice names the countrys.. the uipicker not works for me beacuse its very bigger.. so i need a combox or textfield whit autocomplete but only names to countrys.. any can help me? i make this i iphone?
gunther is offline   Reply With Quote
Old 07-01-2009, 08:29 PM   #2 (permalink)
Tutorial Author
 
Join Date: Jun 2009
Posts: 25
Default

If you have all the countries in a NSDictionary, you could just display them all in an UITableView. Then bind your class to the outlet of an UITextField and make the class use the UITextFieldDelegate protocol, this way you could use the function textFieldDidBeginEditing: to get the string the user is typing. Then it's just a matter of searching through the NSDictionary with countries and at the end update the UITableView. This will not generate autocomplete functionality, but the only way I know how to do that without seriously subclassing views is to use a UISearchBar.

And of course the class should also use the UITableViewDelegate protocol so that you can get notification when the user has clicked on a cell, in this case a country.

Last edited by Bovn; 07-01-2009 at 08:33 PM.
Bovn is offline   Reply With Quote
Old 07-02-2009, 10:49 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 196
Default

but the problem i what i can show the tableview whit the countrys.. because the work area for the control for countrys its small...

iphone dont manage control combox?
gunther is offline   Reply With Quote
Old 07-02-2009, 11:05 AM   #4 (permalink)
Registered Member
 
daveruske's Avatar
 
Join Date: May 2009
Location: Sussex, WI, USA
Posts: 20
Default

Quote:
Originally Posted by gunther View Post
but the problem i what i can show the tableview whit the countrys.. because the work area for the control for countrys its small...

iphone dont manage control combox?
There's no direct support for a control like a combo box; the screen is already small, so popping up a tiny scrolling list of items to choose from is likely to take up most of the screen anyway.

Look at how combo boxes are handled in Safari: when you tap on the combo box on a web page, a picker control pops up. You could take the same approach, or perhaps tapping on that small country field could take the user to a table view where the country could be selected, like Bovn suggests.

Good luck!
daveruske is offline   Reply With Quote
Old 07-02-2009, 11:18 AM   #5 (permalink)
Registered Member
 
Join Date: Nov 2008
Posts: 788
Default

Do not try to fit desktop UI onto iPhone.

Instead, redesign your UI so that you can display the list in a tableview.
johnqh is offline   Reply With Quote
Old 07-02-2009, 11:36 AM   #6 (permalink)
Tutorial Author
 
Join Date: Jun 2009
Posts: 25
Default

I would just hide a UITableView with all the countries. And when the user clicks on a button to choose a country, you simply display that view. Let's face it; the values are mostly known by the user in advance; if he or she is supposed to choose his/her country, it's only a matter of scrolling down to it. Order them all by name only and you should be fine. Index the table aswell. There is not that many countries in the world to make it neccessary for an autocomplete.

All the interfaces on the web that requires the user to specify their country has a list of them in a select box. People just scroll down fast untill the first letter starts to close up on the first letter of their country.

So take the simple route on this one; the user will expect it and probably only become confused if their suddenly introduced to an autocomplete functionality.

Good luck.
Bovn is offline   Reply With Quote
Old 07-02-2009, 01:55 PM   #7 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 196
Default

ok understand.. but where i do can find an example for this implementation?
gunther is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,156
Threads: 38,931
Posts: 170,811
Top Poster: smasher (2,565)
Welcome to our newest member, hoshimori
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:21 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0