Disable creation of backing ASTable/CollectionNode for the *View varients (retain cycle).

This commit is contained in:
Scott Goodson
2016-01-09 20:44:24 -08:00
parent c3ef2efe0c
commit d45db5ac32
5 changed files with 30 additions and 5 deletions

View File

@@ -31,8 +31,10 @@
- (instancetype)_initWithTableView:(ASTableView *)tableView
{
if (self = [super initWithViewBlock:^UIView *{ return tableView; }]) {
__unused ASTableView *tableView = [self view];
// Avoid a retain cycle. In this case, the ASTableView is creating us, and strongly retains us.
ASTableView * __weak weakTableView = tableView;
if (self = [super initWithViewBlock:^UIView *{ return weakTableView; }]) {
__unused __weak ASTableView *view = [self view];
return self;
}
return nil;