IOS-UIPickerView restaurant ordering system

Source: Internet
Author: User

 

 


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

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.