• 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
Asymmetrical behavior in NSMutableArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Asymmetrical behavior in NSMutableArray


  • Subject: Asymmetrical behavior in NSMutableArray
  • From: Serge Meynard <email@hidden>
  • Date: Thu, 10 Mar 2005 00:06:34 -0500

Greetings,

I just discovered something interesting behavior-wise in NSMutableArray... Since the class does not handle duplicates, you can add the same object several times to an array and it will appear in several slots. But if you then call removeObject: on that same object, ALL INSTANCES of the object are removed from the array! I wrote a short test app to confirm that I wasn't dreaming this up.

Is this normal, expected behavior? Shouldn't the class stick to never handling duplicates no matter the method call?

(And yes, I know about NSSet and NSCountedSet... That's not the issue here :)

Serge

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Asymmetrical behavior in NSMutableArray
      • From: Hsu <email@hidden>
    • Re: Asymmetrical behavior in NSMutableArray
      • From: Shawn Erickson <email@hidden>
    • [newbie] SIGSEGV and GDB
      • From: Julien Palmas <email@hidden>
  • Prev by Date: NSWindow setTitle not affecting displayed title
  • Next by Date: [newbie] SIGSEGV and GDB
  • Previous by thread: Re: NSWindow setTitle not affecting displayed title
  • Next by thread: [newbie] SIGSEGV and GDB
  • Index(es):
    • Date
    • Thread