Number of columns-(NSInteger) pickerView :( UIPickerView *) pickerView numberOfRowsInComponent :( NSInteger) component {NSArray * array = _ foods [component]; return array. count;}-(NSString *) pickerView :( UIPickerView *) pickerView titleForRow :( NSInteger) row forComponent :( NSInteger) component {return _ foods [component] [row];} // notification proxy-(void) pickerView (UIPickerView *) pickerView didSelectRow :( NSInteger) row inComponent :( NSInteger) component {
[_ PickerView selectRow: index inComponent: component animated: YES];
****- (IBAction)randomFood:(
<UIPickerViewDataSource, UIPickerViewDelegate>
ViewController () <UIPickerViewDataSource, UIPickerViewDelegate>*- ( _foods = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource: count = ( i = ; i < count; i++
Mark-how many columns does the data source mark have-(NSInteger) numberOfComponentsInPickerView :( UIPickerView * mark the number of rows in the component column-(NSInteger) pickerView :( UIPickerView ** array = mark what is displayed on each line and what is displayed on the row of the component column-(NSString *) pickerView :( UIPickerView *
When the mark-proxy mark selects the row of the component column, it will call-() pickerView :( UIPickerView * NSString * text = (component =) {_ fruit. text = (component =) {_ meat. text = {_ water. text =
Mark random-(IBAction) randomFood :( count = (I =; I <count; I ++ mark the method for randomly selecting a column -() randomCompoment :( selectedRow = index = (index =
Clear Saup