On 3 Feb 2010, at 00:28, Robert Monaghan wrote: > Its a fairly deep copy. There are several nodes deep. > I am trying to copy parts of the tree, so that I don't have to write code to > regenerate them.
No. The question was not "is your tree deep?" but is the "copy" method implemented by NSXMLNode a deep or shallow copy i.e. does it copy the children of the node too or just reference the existing ones. If it's a deep copy, you should be able to do copyNode = [node copy]; > > bob. > > On Feb 2, 2010, at 4:26 PM, Jens Alfke wrote: > >> >> On Feb 2, 2010, at 4:16 PM, Robert Monaghan wrote: >> >>> Is there an easy way to clone an XML tree in Cocoa? Or will I be going thru >>> recursion code hell? >> >> Did you try -copy? NSXMLNode implements NSCopying. The only question is >> whether it's a deep or a shallow copy. >> >> —Jens > > _______________________________________________ > > Cocoa-dev mailing list ([email protected]) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/adc%40jeremyp.net > > This email sent to [email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
