Skip to content

Commit

Permalink
fix(ios): fix list-view crash (#12590)
Browse files Browse the repository at this point in the history
  • Loading branch information
build committed Mar 16, 2021
1 parent 65ed909 commit 7c1aa59
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions iphone/Classes/TiUIListItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ - (void)setDataItem:(NSDictionary *)dataItem
switch (_templateStyle) {
case UITableViewCellStyleSubtitle:
case UITableViewCellStyleValue1:
case UITableViewCellStyleValue2:
case UITableViewCellStyleValue2: {
self.detailTextLabel.text = [[properties objectForKey:@"subtitle"] description];
self.detailTextLabel.backgroundColor = [UIColor clearColor];

Expand All @@ -425,9 +425,10 @@ - (void)setDataItem:(NSDictionary *)dataItem
}];
}
}
}

// pass through
case UITableViewCellStyleDefault:
case UITableViewCellStyleDefault: {
self.textLabel.text = [[properties objectForKey:@"title"] description];
self.textLabel.backgroundColor = [UIColor clearColor];
if (_templateStyle != UITableViewCellStyleValue2) {
Expand Down Expand Up @@ -481,8 +482,9 @@ - (void)setDataItem:(NSDictionary *)dataItem
}
}
break;
}

default:
default: {
[dataItem enumerateKeysAndObjectsUsingBlock:^(NSString *bindId, id dict, BOOL *stop) {
if (![dict isKindOfClass:[NSDictionary class]] || [bindId isEqualToString:@"properties"]) {
return;
Expand Down Expand Up @@ -511,6 +513,7 @@ - (void)setDataItem:(NSDictionary *)dataItem
}];
break;
}
}
id accessoryTypeValue = [properties objectForKey:@"accessoryType"];
if ([self shouldUpdateValue:accessoryTypeValue forKeyPath:@"accessoryType"]) {
if ([accessoryTypeValue isKindOfClass:[NSNumber class]]) {
Expand Down

0 comments on commit 7c1aa59

Please sign in to comment.