Return to Snippet

Revision: 14256
at May 26, 2009 20:18 by arpit


Initial Code
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {	
	return 1;
}

- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {	
	return [foodTypes count];
}

- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
	return [foodTypes objectAtIndex:row];
}

- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
		//NSLog(@"Selected Color: %@. Index of selected color: %i", [foodTypes objectAtIndex:row], row);
}

Initial URL


Initial Description
1) Make sure the ViewController for the view implements the \< UIPickerViewDelegate, >

Initial Title
Using UIPickerView

Initial Tags
iphone

Initial Language
Objective C