Hey,
I've got a UIPickerView like:
Code:
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {
return 1;
}
-(NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {
return[list count];
}
-(NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {
return[list objectAtIndex:row];
}
-(void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {
NSLog(@"Selected item: %@. Index of selected item: %i",[list objectAtIndex:row], row);
}
And a NSMutableArray like:
Code:
list = [[NSMutableArray alloc] init];
[list addObject:@"Word1"];
[list addObject:@"Word2"];
[list addObject:@"Word3"];
Now I want that if the user choose "Word1", "Word1" is shown in a label.
How can I do this?