• 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: mutable deep copying?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mutable deep copying?


  • Subject: Re: mutable deep copying?
  • From: Daryn <email@hidden>
  • Date: Sun, 28 Jul 2002 14:55:22 -0500

Unless I'm confused, this suggestion would yield a deep copy with only the top-level dictionary being mutable. I want a mutable copy of the entire data structure. Ie. all the child objects of the dictionary should be mutable too.

I'm storing a mutable data structure into user defaults, and now I want to make the retrieved data structure fully mutable again. Perhaps I've overlooked some defaults method for doing this?

On Sunday, July 28, 2002, at 02:46 PM, Andrew Pinski wrote:

What about doing `id temp = [myDict copy]; need = [temp mutableCopy]; [temp release];temp=null;'?


Thanks,
Andrew Pinski


On Sunday, July 28, 2002, at 03:35 , Daryn wrote:

It seems that [myDict copy] results in a deep copy, while [myDict mutableCopy] results in a shallow, yet mutable, copy. What I need is a mutable deep copy of the dictionary.

My data structure is composed of simple dictionaries, arrays, and strings. Is there a simple method by which I may obtain a mutable copy of the entire data structure? Or do I need to implement my own protocol to do this?

Daryn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: mutable deep copying? (From: Andrew Pinski <email@hidden>)

  • Prev by Date: Re: mutable deep copying?
  • Next by Date: More memory allocation questions
  • Previous by thread: Re: mutable deep copying?
  • Next by thread: Re: mutable deep copying?
  • Index(es):
    • Date
    • Thread