• 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: ARC Extending Lifetime of Objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC Extending Lifetime of Objects


  • Subject: Re: ARC Extending Lifetime of Objects
  • From: Mike Abdullah <email@hidden>
  • Date: Mon, 23 Jul 2012 13:04:24 +0100

On 23 Jul 2012, at 12:57, Andreas Grosam <email@hidden> wrote:

>
> On 23.07.2012, at 13:09, Mike Abdullah wrote:
>
>> Aha, now we're talking. You want -initWithDictionary:copyItems:
>
> No, this is not a deep copy.
>
> Suppose, there is an element within the array, whose value is a mutable dictionary. If I change the that mutable dictionary (or its values), the copy and the dictionary would still compare equal to the copy (since children haven't been copied).
>
>
> Thus, I need to define a deepCopy method for NSDictionary (and NSArray, too).

You should seriously consider whether your design is a good idea then. Copying the objects in an array is rare, but justifiable. Having multiple levels of nested dictionaries is rarely so. Sure you're not (ab)using dictionaries to avoid defining a new class?


_______________________________________________

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

  • Follow-Ups:
    • Re: ARC Extending Lifetime of Objects
      • From: Andreas Grosam <email@hidden>
References: 
 >ARC Extending Lifetime of Objects (From: Andreas Grosam <email@hidden>)
 >Re: ARC Extending Lifetime of Objects (From: Mike Abdullah <email@hidden>)
 >Re: ARC Extending Lifetime of Objects (From: Andreas Grosam <email@hidden>)
 >Re: ARC Extending Lifetime of Objects (From: Mike Abdullah <email@hidden>)
 >Re: ARC Extending Lifetime of Objects (From: Andreas Grosam <email@hidden>)

  • Prev by Date: Re: ARC Extending Lifetime of Objects
  • Next by Date: Re: ARC Extending Lifetime of Objects
  • Previous by thread: Re: ARC Extending Lifetime of Objects
  • Next by thread: Re: ARC Extending Lifetime of Objects
  • Index(es):
    • Date
    • Thread