1. How to use
Uipickerview use and UITableView are roughly similar. First set Viewcontroller as the data source, then follow the data source protocol < UIPICKERVIEWDATARECOUCE>, and then implement the method in the protocol:
Total number of columns:
-(Nsinteger) Numberofcomponentsinpickerview: (Uipickerview *)
Pickerview;
Section Component column shows how many rows :
-(Nsinteger) Pickerview: (Uipickerview *)Pickerview
Numberofrowsincomponent: (Nsinteger)component;
Above can only set Uipickerview how many rows, how many columns, can not set the data, if you want to display data, you must set Viewcontroller as Uipickerview agent, abide by the proxy protocol <uipickerviewdelegate Then implement the methods in the proxy:
Section Component column, section Row What text is displayed on the line :
-(NSString *) Pickerview: (Uipickerview *)pickerview Titleforrow:
(Nsinteger) row forcomponent: (nsinteger)component;
Section Component Column No. Row what does the line show? View ( content ) :
-(UIView *) Pickerview: (Uipickerview *)pickerview Viewforrow:
(Nsinteger) row forcomponent: (nsinteger)component Reusingview:
(UIView *) View;
checked the Pickerview the first Component Column No. Row Line
-(void) Pickerview: (Uipickerview *)pickerview Didselectrow:
(Nsinteger) row incomponent: (nsinteger)component
iOS Development Uipickerview