Contents

replaceChild(at:with:)

Replaces the child node of the receiver located at a specified position in its array of children with another node.

Declaration

func replaceChild(at index: Int, with node: XMLNode)

Parameters

  • index:

    An integer identifying a position in the receiver’s array of children. If index is less than zero or greater than the number of children minus one, an out-of-bounds exception is raised.

  • node:

    An Xmlnode object to replace the one at index; it must represent a comment, a processing instruction, or the root element.

Discussion

The removed NSXMLNode object is autoreleased.

See Also

Adding and Removing Child Nodes