• 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: Is that really a bug at all? (was: Re: Ugly bug in Foundation, beware!)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is that really a bug at all? (was: Re: Ugly bug in Foundation, beware!)


  • Subject: Re: Is that really a bug at all? (was: Re: Ugly bug in Foundation, beware!)
  • From: Julien Dufour <email@hidden>
  • Date: Sun, 6 Jun 2004 10:37:30 +0200

Hello

I think that the "bug/not bug" debate is pointless. The copy implementation of the Cocoa collections is shallow. Fine. Both points of view can be justified but the behavior is not going to change since it would break many applications. The only thing that can (and should) be done about it is to explicitly document the classes so that nobody gets misled again.

However, shallow and deep copies are both useful. Although it is easy to write some code providing the deep behavior (make some DeepCopy protocol and a few categories), such a feature would be welcome natively in the Cocoa frameworks. I'm pretty sure it would be more efficient because of the class clusters.

Personally, especially concerning the collections, I would appreciate something more customizable like:

- (id) deepCopyUsingFunction:(BOOL (*)(id))filter;

The "filter" function simply tells wether a given child should be copied or not. Such a simple function is probably not flexible enough, a context and maybe a reference to the original parent could be passed along.

Best regards.

Julien Dufour
Inferiis - http://www.inferiis.com
_______________________________________________
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: 
 >Ugly bug in Foundation, beware! (From: Ondra Cada <email@hidden>)
 >Is that really a bug at all? (was: Re: Ugly bug in Foundation, beware!) (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: NSObjectController HELP
  • Next by Date: Re: Subclassing NSCell: Checkbox and Text?
  • Previous by thread: Re: Is that really a bug at all? (was: Re: Ugly bug in Foundation, beware!)
  • Next by thread: Re: Ugly bug in Foundation, beware!
  • Index(es):
    • Date
    • Thread