user232751
user232751

Reputation: 619

Multiple value to UIPicker View

I have a UI picker view to store child details, i got the value through a web service.I was added child name to picker view , now it shows all childs.

I also have one more value child id to store in the picker view, when a user select a child i need to get the id of the corresponding child.How i add multiple values to same row a pickerview.

Thanks, Companion

Upvotes: 0

Views: 331

Answers (2)

Madan Mohan
Madan Mohan

Reputation: 8810

I got it you want to store its Id too then you have to use an object to handle this

int selectedRow = [childPicker selectedRowInComponent:0];
Child *childObj = [childsList objectAtIndex:selectedRow];

Here in childObject, You have stored this values. childObj.childName; childObj.childId;

Upvotes: 1

Swastik
Swastik

Reputation: 2425

You can basically use a pickerView with two components.set the text to picker label based on component

Upvotes: 0

Related Questions