“Since the cat_body sprite is not a direct child of the scene, you can’t simply provide the name cat_body to childNodeWithName(_ and expect to get it back”
bed_Node or bed sprite is a child of the scene node.
cat_Node has a cat body and it is that cat body which will have the physics body. The rest of the cat, whiskers and eyes etc, are part of the cat_Node but will not have a physics body.
Earlier on p229 you saw how to search recursively:
enumerateChildNodesWithName("//*", usingBlock: {node, _ in
if let customNode = node as? CustomNodeEvents {
customNode.didMoveToScene()
}
})
That is why you get a reference to bed like this: bedNode = childNodeWithName("bed") as! BedNode
and a reference to cat like this: catNode = childNodeWithName("//cat_body") as! CatNode
because you are looking through the children of the scene.
So the parent! of your cat physics body, is the cat_Node.