私はpickerViewを持つカスタムセルを作成しています。私は最初のピッカービューの値を変更し、下にスクロールすると、4つのセルが表示されます。 4番目のすべてのピッカーの値が変更されました。すべてのピッカービューの値を取得し、正しい値を返します。これは、最初のピッカービューの値のみを変更することを意味します。dequeueReusableCellWithIdentifier複数のUIPickerviews値を変更する
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
AddTaskTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"addTaskCell" forIndexPath:indexPath];
AddTaskDetails *task =[self.tasksArray objectAtIndex:indexPath.row];
NSAttributedString *attributedString = [self attributedTextForTask:task.taskDetail];
cell.taskDetails.attributedText = attributedString;
cell.hourePicker.tag = indexPath.row;
[cell.hourePicker selectRow:0 inComponent:0 animated:YES];
cell.addDescriptionBtn.tag = indexPath.row;
[cell.addDescriptionBtn addTarget:self action:@selector(didTapAddDescButton:) forControlEvents:UIControlEventTouchUpInside];
return cell; }
は、私はそれを行っています。しかし、今私は私のテーブルビューをスクロールする場合、それはデフォルト値にすべてのピッカービューをリセットします。 –
デキューするためのメソッドを提供できますか? ピッカーで選択した値はどこに保存されていますか? – anierzad
私は自分の質問を編集しています。 –