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

@@ -150,7 +150,10 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
if (!ownedByNode) {
// See commentary at the definition of .strongCollectionNode for why we create an ASCollectionNode.
ASCollectionNode *collectionNode = [[ASCollectionNode alloc] _initWithCollectionView:self];
// FIXME: The _view pointer of the node retains us, but the node will die immediately if we don't
// retain it. At the moment there isn't a great solution to this, so we can't yet move our core
// logic to ASCollectionNode (required to have a shared superclass with ASTable*).
ASCollectionNode *collectionNode = nil; //[[ASCollectionNode alloc] _initWithCollectionView:self];
self.strongCollectionNode = collectionNode;
}
@@ -349,6 +352,11 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
return [[_dataController nodeAtIndexPath:indexPath] calculatedSize];
}
- (NSArray<NSArray <ASCellNode *> *> *)completedNodes
{
return [_dataController completedNodes];
}
- (ASCellNode *)nodeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return [_dataController nodeAtIndexPath:indexPath];