Instance Method

removeFromParentNode

Removes the node from its parent’s array of child nodes.

Declaration

- (void)removeFromParentNode;

Discussion

Removing nodes from the node hierarchy serves two purposes. Nodes own their contents (child nodes or attached lights, geometries, and other objects), so deallocating unneeded nodes can reduce memory usage. Additionally, SceneKit does more work at rendering time with a large, complex node hierarchy, so removing nodes whose contents you don’t need to display can improve rendering performance.

See Also

Managing the Node Hierarchy

parentNode

The node’s parent in the scene graph hierarchy.

childNodes

An array of the node’s children in the scene graph hierarchy.

- addChildNode:

Adds a node to the node’s array of children.

- insertChildNode:atIndex:

Adds a node to the node’s array of children at a specified index.

- replaceChildNode:with:

Removes a child from the node’s array of children and inserts another node in its place.