CooperRS / RMPickerViewController

This is an iOS control for selecting something using UIPickerView in an UIAlertController like manner
MIT License
381 stars 51 forks source link

Get the text of selected rows #3

Closed haxinc closed 10 years ago

haxinc commented 10 years ago

Hi,

How chould I get the text/NSString of selected rows ?

Thanks

CooperRS commented 10 years ago

selectedRows is an array containing NSNumbers. selectedRows[0] contains the selected row in component 0 of your picker view. selectedRows[1] contains the selected row in component 1 of your picker view and so on.

Therefore, you can get the title of the selected row in a certain component just like you calculated the title in

or

Hope this helps :)

haxinc commented 10 years ago

Hmmm I think I didn't get the point since I tried selectedRows[0] it also shows number

CooperRS commented 10 years ago

Right, selectedRows[0] contains the selected row in component 0. Knowing the index of the selected row also means that you know the title, as in

or

you also need a title for a certain index. You just need to re-use that knowledge.

haxinc commented 10 years ago

Okay, I understood .. Thank for a rapidly reply!

CooperRS commented 10 years ago

Ok, then I will close this ticket.