I have a textfield. once I tap on that I want a UIPickerView
to pop out and select an item from the UIPickerView
and after once I am done with the selection I want to confirm the selection by tapping on an UIActionSheet
which has confirm button on it.So my requirement is to have a UIActionSheet
and beneath that a picker view. I am just a beginner in iOS development and I am still not familiar with the technical terminologies. So please bear with my informal way of asking questions.
Here is my block of code:
creating UIPickerView and UIActionSheet
UIActionSheet *confirmRoomSelectionAS =[[UIActionSheet alloc]initWithTitle:@"" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Done",nil];
UIPickerView *roomTypePicker=[[UIPickerView alloc]init];
[confirmRoomSelectionAS addSubview:roomTypePicker];
[confirmRoomSelectionAS showInView:self.view];
[confirmRoomSelectionAS setBounds:CGRectMake(0, 0, 320, 600)];
[roomTypePicker setFrame:CGRectMake(0, 170, 320, 216)];
[roomTypePicker setDataSource:self];
[roomTypePicker setDelegate: self];
roomTypePicker.showsSelectionIndicator = YES;