From 66acd69e22f99eea3d56f27b48e3820a88d8a06e Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Thu, 1 Dec 2016 07:03:39 -0800 Subject: [PATCH] Better error message if a display node is created in layoutSpecThatFits: and deallocated before it was added to a subnode --- AsyncDisplayKit/Private/ASLayoutTransition.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsyncDisplayKit/Private/ASLayoutTransition.mm b/AsyncDisplayKit/Private/ASLayoutTransition.mm index 9c8df8cbd2..e22601f6ea 100644 --- a/AsyncDisplayKit/Private/ASLayoutTransition.mm +++ b/AsyncDisplayKit/Private/ASLayoutTransition.mm @@ -233,7 +233,7 @@ static inline std::vector findNodesInLayoutAtIndexesWithFilteredNode if (idx > lastIndex) { break; } if (idx >= firstIndex && [indexes containsIndex:idx]) { ASDisplayNode *node = (ASDisplayNode *)sublayout.layoutElement; - ASDisplayNodeCAssert(node, @"A flattened layout must consist exclusively of node sublayouts"); + ASDisplayNodeCAssert(node, @"ASDisplayNode was deallocated before it was added to a subnode. It's likely the case that you use automatically manages subnodes and allocate a ASDisplayNode in layoutSpecThatFits: and don't have any strong reference to it."); // Ignore the odd case in which a non-node sublayout is accessed and the type cast fails if (node != nil) { BOOL notFiltered = (filteredNodes == nil || [filteredNodes indexOfObjectIdenticalTo:node] == NSNotFound);