Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

TTTableView shadow crash fix #755

Merged
merged 1 commit into from

1 participant

@aporat

TTTableView with shadows (self.showTableShadows = YES) will cause a crash under iOS 5 when the user tries to scroll inside the table.

This crash happens because the layoutSubviews function tries to use the shadow layer after the layer was already removed and released. This is an issue in iOS 5, because layers are automatically released when removeFromSuperlayer is called.

The fix creates a new shadow layer after the original shadow layer is released and removed. Generally, a layer shouldn't be used after removeFromSuperlayer is called.

Closes #733 as well.

@aporat aporat referenced this pull request
Closed

TTableView Shadow Crash #733

@aporat aporat merged commit ff2fe77 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 20, 2012
  1. @aporat
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/Three20UI/Sources/TTTableView.m
View
4 src/Three20UI/Sources/TTTableView.m
@@ -258,7 +258,9 @@ - (void)layoutSubviews {
} else if (![[self.layer.sublayers objectAtIndex:0] isEqual:_originShadow]) {
[_originShadow removeFromSuperlayer];
- [self.layer insertSublayer:_originShadow atIndex:0];
+
+ _originShadow = [self shadowAsInverse:NO];
+ [self.layer insertSublayer:_originShadow atIndex:0];
}
[CATransaction begin];
Something went wrong with that request. Please try again.