Skip to content

Commit

Permalink
reverted xmartlabs#948
Browse files Browse the repository at this point in the history
  • Loading branch information
ikorich committed Feb 14, 2019
1 parent 9ead0bb commit 4f6de43
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions XLForm/XL/Cell/XLFormSelectorCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,19 @@ -(NSString *)valueDisplayText
}
}
NSMutableArray * descriptionArray = [NSMutableArray arrayWithCapacity:[self.rowDescriptor.value count]];
//add by OE Ex: value taken form the lacal cache but selectorOptions in the networking
if (self.rowDescriptor.selectorOptions.count > 0) {

for (id option in self.rowDescriptor.selectorOptions) {
NSArray * selectedValues = self.rowDescriptor.value;
if ([selectedValues formIndexForItem:option] != NSNotFound){
if (self.rowDescriptor.valueTransformer){
NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
NSString * tranformedValue = [valueTransformer transformedValue:option];
if (tranformedValue){
[descriptionArray addObject:tranformedValue];
}
}
else{
[descriptionArray addObject:[option displayText]];
for (id option in self.rowDescriptor.selectorOptions) {
NSArray * selectedValues = self.rowDescriptor.value;
if ([selectedValues formIndexForItem:option] != NSNotFound){
if (self.rowDescriptor.valueTransformer){
NSAssert([self.rowDescriptor.valueTransformer isSubclassOfClass:[NSValueTransformer class]], @"valueTransformer is not a subclass of NSValueTransformer");
NSValueTransformer * valueTransformer = [self.rowDescriptor.valueTransformer new];
NSString * tranformedValue = [valueTransformer transformedValue:option];
if (tranformedValue){
[descriptionArray addObject:tranformedValue];
}
}
}
} else {
for (id option in self.rowDescriptor.value) {
if ([option isKindOfClass:[XLFormOptionsObject class]]) {
XLFormOptionsObject *newOption = (XLFormOptionsObject*)option;
[descriptionArray addObject:newOption.formDisplayText];
}
else {
[descriptionArray addObject:[NSString stringWithFormat:@"%@",option]];
else{
[descriptionArray addObject:[option displayText]];
}
}
}
Expand Down

0 comments on commit 4f6de43

Please sign in to comment.