diff --git a/PodCode/Classes/CRBoxInputCellProperty.h b/PodCode/Classes/CRBoxInputCellProperty.h index 1a0c9b2..30be9be 100644 --- a/PodCode/Classes/CRBoxInputCellProperty.h +++ b/PodCode/Classes/CRBoxInputCellProperty.h @@ -141,7 +141,8 @@ typedef void(^ConfigCellShadowBlock)(CALayer *layer); 若想一次性修改所有输入值,请使用 CRBoxInputView中的'reloadInputString'方法 禁止修改该值!!!(除非你知道该怎么使用它。) */ -@property (copy, nonatomic) NSString *originValue; +@property (copy, nonatomic, readonly) NSString *originValue; +- (void)setMyOriginValue:(NSString *)originValue; /** 密文类型 diff --git a/PodCode/Classes/CRBoxInputCellProperty.m b/PodCode/Classes/CRBoxInputCellProperty.m index 0898de9..31a6d72 100644 --- a/PodCode/Classes/CRBoxInputCellProperty.m +++ b/PodCode/Classes/CRBoxInputCellProperty.m @@ -9,6 +9,13 @@ #import "CRBoxInputCellProperty.h" #import +@interface CRBoxInputCellProperty () + +@property (copy, nonatomic, readwrite) NSString *originValue; + +@end + + @implementation CRBoxInputCellProperty - (instancetype)init @@ -142,4 +149,9 @@ return customSecurityView; } +#pragma mark - Setter +- (void)setMyOriginValue:(NSString *)originValue { + _originValue = originValue; +} + @end diff --git a/PodCode/Classes/CRBoxInputView.m b/PodCode/Classes/CRBoxInputView.m index 2b90e1e..8a5db96 100755 --- a/PodCode/Classes/CRBoxInputView.m +++ b/PodCode/Classes/CRBoxInputView.m @@ -389,9 +389,9 @@ typedef NS_ENUM(NSInteger, CRBoxTextChangeType) { // setOriginValue NSUInteger focusIndex = _valueArr.count; if (_valueArr.count > 0 && indexPath.row <= focusIndex - 1) { - cellProperty.originValue = _valueArr[indexPath.row]; + [cellProperty setMyOriginValue:_valueArr[indexPath.row]]; }else{ - cellProperty.originValue = @""; + [cellProperty setMyOriginValue:@""]; } cell.boxInputCellProperty = cellProperty;