Re: Cloning an NSXMLElement and its children?
Re: Cloning an NSXMLElement and its children?
- Subject: Re: Cloning an NSXMLElement and its children?
- From: Jeremy Pereira <email@hidden>
- Date: Wed, 3 Feb 2010 09:30:02 +0000
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@hidden)
>
> 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:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden