You have to create outlet for your label, and after clicking on an option you will be able to set:
label.text = @"Selected value";
But actually, your solution is going against Human Interface Guideline. Ii is better to use UIPickerView for "combo box like" drop-down list. You can even simplify solution using UITextField + UIPickerView. You can set a custom view for text field instead of keyboard, and when you activate the text field - your custom view will appear nicely. You have to use property inputView in text field.
UIPickerView *pickerView = [[UIPickerView alloc] init];
// Set delegate and other configs for picker view
textField.inputView = pickerView;
After that when you select a text filed - picker view will swipe up just like default keyboard does. You just need to handle UIPickerView delegate and data source methods to fill it and catch the selection:
– numberOfComponentsInPickerView:
– pickerView:numberOfRowsInComponent:
– pickerView:titleForRow:forComponent:
– pickerView:didSelectRow:inComponent:
This methods should be implemented for correct behavior of picker view. And method
– pickerView:didSelectRow:inComponent:
will be called when you select any row in picker view, and you can set needed value for text field there:
-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
textField.text = [NSString stringWithFormat:@"Selected row is: %d", row];
}