I am amazed at the problem when I need to implement a selector of several types, so for this I do this:
caratFromPicker = [[UIPickerView alloc] init]; caratTable = [[UITableView alloc]initWithFrame:caratFromPicker.frame style:UITableViewStylePlain]; caratTable.delegate = self; caratTable.dataSource = self; caratTable.bounces = YES; UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonItemStyleDone target:self action:@selector(done)]; UIToolbar *toolBar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, self.view.frame.size.height-caratFromPicker.frame.size.height-50, self.view.frame.size.width, 50)]; [toolBar setBarStyle:UIBarStyleBlackOpaque]; NSArray *toolbarItems = [NSArray arrayWithObjects:doneButton, nil]; [toolBar setItems:toolbarItems]; price1.inputView = caratFromPicker; price1.inputAccessoryView = toolBar; [caratFromPicker setDataSource: self]; [caratFromPicker setDelegate: self]; caratFromPicker.showsSelectionIndicator = YES;
and implemented UITableView delegates as:
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return 1; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return [caratFromArray count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell";
here is a screenshot of the same: 
but my problem is that I cannot scroll the table view to view the following values.
source share