iphone - UIPickerView programatic example? -



iphone - UIPickerView programatic example? -

how programmatically setup uipickerview in view without using interface builder? having problem understanding how work delegate portions of uipickerview.

thanks

it goes follows add together uipickerview programmatically:

- (void)pickerview:(uipickerview *)pv didselectrow:(nsinteger)row incomponent:(nsinteger)component { if(component == 1) selectedrowpicker1 = row; else if(component == 2) selectedrowpicker2 = row; else selectedrowpicker3 = row; } - (nsinteger)numberofcomponentsinpickerview:(uipickerview *)pickerview { homecoming 3; } - (nsinteger)pickerview:(uipickerview *)pickerview numberofrowsincomponent:(nsinteger)component { if(component == 1) homecoming [list1 count]; else if(component == 2) homecoming [list2 count]; else homecoming [list3 count]; } - (nsstring *)pickerview:(uipickerview *)pickerview titleforrow:(nsinteger)row forcomponent:(nsinteger)component { if(component == 1) val1 = [list1 objectatindex:row]; else if(component == 2) val2 = [list2 objectatindex:row]; else val3 = [list3 objectatindex:row]; homecoming strtemp; }

let me know if have questions in uipickerview implementation.

iphone objective-c xcode cocoa-touch

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -