Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* iPhone picker and textField *\
- - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
- {
- return [arraySubject count];
- }
- - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
- return 1;
- }
- //Puts the row into the subject textField
- - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
- {
- subject.text=[arraySubject objectAtIndex:row];
- }
- //Desired item
- - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
- {
- return [arraySubject objectAtIndex:row];
- [picker removeFromSuperview];
- }
Advertisement
Add Comment
Please, Sign In to add comment