From 21dd433b60bf9f3042627cd312e16a26bbfed4c9 Mon Sep 17 00:00:00 2001 From: gjcbo <421624358@qq.com> Date: Tue, 18 Dec 2018 15:15:21 +0800 Subject: [PATCH] =?UTF-8?q?BRStringPickerView=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=80=E5=A4=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StringPickerView/BRStringPickerView.m | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/BRPickerView/StringPickerView/BRStringPickerView.m b/BRPickerView/StringPickerView/BRStringPickerView.m index 500b502..9b95810 100755 --- a/BRPickerView/StringPickerView/BRStringPickerView.m +++ b/BRPickerView/StringPickerView/BRStringPickerView.m @@ -162,7 +162,8 @@ - (void)configDataSource:(id)dataSource defaultSelValue:(id)defaultSelValue { // 默认滚动的行 [self.pickerView selectRow:row inComponent:i animated:NO]; } - self.selectValueArr = [tempArr copy]; +// self.selectValueArr = [tempArr copy]; + self.selectValueArr = tempArr; // } } @@ -237,15 +238,17 @@ - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComp break; case BRStringPickerComponentMore: { - NSMutableArray *tempArr = [NSMutableArray array]; - for (NSInteger i = 0; i < self.selectValueArr.count; i++) { - if (i == component) { - [tempArr addObject:self.dataSourceArr[component][row]]; - } else { - [tempArr addObject:self.selectValueArr[i]]; - } - } - self.selectValueArr = tempArr; +// NSMutableArray *tempArr = [NSMutableArray array]; +// for (NSInteger i = 0; i < self.selectValueArr.count; i++) { +// if (i == component) { +// [tempArr addObject:self.dataSourceArr[component][row]]; +// } else { +// [tempArr addObject:self.selectValueArr[i]]; +// } +// } +// self.selectValueArr = tempArr; + + self.selectValueArr[component] = self.dataSourceArr[component][row];//直接修改 // 设置是否自动回调 if (self.isAutoSelect) {