• 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: Clark Cox <email@hidden>
  • Date: Thu, 3 Jun 2004 09:38:25 -0400

On Jun 03, 2004, at 09:05, Ondra Cada wrote:

> Hi all,
>
> just bumped into this: mutable arrays do *NOT* deep copy upon receiving

I'm not sure I'd call this a bug. None of the Foundation objects
perform deep copies, and I don't think that they ever have. If the
objects did deep copies by default, one could get into some very hairy
situations at edge cases. For example:

{
id a = [[NSMutableArray alloc] init];
id b = [[NSMutableArray alloc] init];
id c = nil;

[a addObject: b];
[b addObject: a];

c = [a copy]; //If copy performs a deep copy, then this is an
infinite loop
}

--
Clark S. Cox III
email@hidden
http://homepage.mac.com/clarkcox3/
http://homepage.mac.com/clarkcox3/blog/B1196589870/index.html

[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: Ondra Cada <email@hidden>
References: 
 >Ugly bug in Foundation, beware! (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: Getting keyboard events first
  • Next by Date: Re: Ugly bug in Foundation, beware!
  • Previous by thread: Ugly bug in Foundation, beware!
  • Next by thread: Re: Ugly bug in Foundation, beware!
  • Index(es):
    • Date
    • Thread