• 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: Ugly bug in Foundation, beware!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ugly bug in Foundation, beware!


  • Subject: Re: Ugly bug in Foundation, beware!
  • From: Ondra Cada <email@hidden>
  • Date: Thu, 3 Jun 2004 16:15:33 +0200

Zach,

On 3.6.2004, at 15:40, Zach Wily wrote:

> Nowhere in the documentation (that I can find) does it say that
> [NSMutableArray -copy] performs a deep copy. Why do you assume that it
> does?

For it is the only logical thing presumed copy should give me my own,
non-shared snapshot of the object, useable for tasks like undo. Which
it should.

Among others, the howler makes it pretty impossible to use a decent
hash -- now it is self-evident why using arrays for dictionary keys is
so terribly inefficient!

> (If it were to perform a deep copy, you'd only be able to add objects
> to NSMutableArrays that conformed to NSCopying, which I don't think
> any of us want.)

Such objects of course would be shared. If a non-copiable object is
used in a structure of which a snapshot is to be taken, it is a similar
*programmer's* bug as if placing a mutable and shared object into an
immutable array.
---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.


  • Follow-Ups:
    • Re: Ugly bug in Foundation, beware!
      • From: "Louis C. Sacha" <email@hidden>
References: 
 >Ugly bug in Foundation, beware! (From: Ondra Cada <email@hidden>)
 >Re: Ugly bug in Foundation, beware! (From: Zach Wily <email@hidden>)

  • Prev by Date: Re: Debugging under 10.2
  • Next by Date: Re: Is that really a bug at all? (was: Re: Ugly bug in Foundation, beware!)
  • Previous by thread: Re: Ugly bug in Foundation, beware!
  • Next by thread: Re: Ugly bug in Foundation, beware!
  • Index(es):
    • Date
    • Thread