• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cloning an NSXMLElement and its children?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Cloning an NSXMLElement and its children? (From: Robert Monaghan <email@hidden>)
 >Re: Cloning an NSXMLElement and its children? (From: Jens Alfke <email@hidden>)
 >Re: Cloning an NSXMLElement and its children? (From: Robert Monaghan <email@hidden>)

  • Prev by Date: Re: tab view look
  • Next by Date: Synthesize NSMutableString retain count question
  • Previous by thread: Re: Cloning an NSXMLElement and its children?
  • Next by thread: NSFont to CGFontRef
  • Index(es):
    • Date
    • Thread