Does removeFromParent on SKNode destroy an instance?

Reading Apple documentation about removeFromParent says:

"Removes the receiving node from its parent."

Does this mean that the node is destroyed? Does node need to be set to NULL to free its memory?

+4
source share
1 answer

An object (with ARC) is freed if there is no strong reference to it. A node, which is a child, is a strong link; deleting a node usually frees the node if it does not have a reference to it.

You can easily verify this by implementing -(void) deallocand setting the breakpoint operator or in it NSLog.

+7
source

Source: https://habr.com/ru/post/1527695/


All Articles