Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Populate a picker wheel from core data results?

alilongdenalilongden Posts: 10New Users
Good morning everyone!

I have an app that I would like to update to suit user comments. Basically its a core data app where users save information about a specific thing. The setup is very typical;

Records ----> Detail ----> Edit

Now, I would like the users to be able to select previous information from a picker wheel. For example the user may have a record where the location is London, a record where Nottingham is saved etc etc. When the user comes along to make a new record i'd like to give them the option to see a populated picker with all previous entrys listed to make it quicker and easier for them as much of the information may be duplicated i.e. entered on a previous record.

So im thinking that I need to interogate the core database table, get all entrys that are not null in the location column, turn them into an array and then display them in my picker?

Does anyone have any ideas how this would be done? I am happy with creating a picker as i have others on the page - i'd just like to know how to populate it with my desired information from my core database?

Many thanks.


  • GHuebnerGHuebner Posts: 665Registered Users @ @ @
    If you have the records in your core data, you can just create your NSFetchRequest, NSSortDescriptors and NSPredicates and execute the fetch. You should be returned a NSArray of the results. Use that array for the population of your Picker. Then you can decide if you want to update the object or create a new one.
Sign In or Register to comment.