• 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
A strange behavior of unionSet?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A strange behavior of unionSet?


  • Subject: A strange behavior of unionSet?
  • From: Thomas Lachand-Robert <email@hidden>
  • Date: Sun, 25 Jan 2004 14:09:24 +0100

Is anyone aware of a possible problem in unionSet (a method in NSMutableSet)? Or is there something I don't understand?

I have the following code, where set1 and set2 are two sets containing each only one element:
NSMutableSet* s = [set1 mutableCopy];
s = [s unionSet:set2];

Then I get a nil pointer for s, after unionSet! (I don't understand how possibly unionSet could return a nul pointer; anyway it does here).
On the other hand, if I change the code to:
NSMutableSet* s = [set1 mutableCopy];
[s addObjectsFromArray:[set2 allObjects]];

then I get a two elements set as expected.

Any clue about this?
Thanks,

Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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: A strange behavior of unionSet?
      • From: Pete Yandell <email@hidden>
  • Prev by Date: Re: [APP IDEA] Desktop Background Scripting
  • Next by Date: Re: A strange behavior of unionSet?
  • Previous by thread: Re: development vs deployment: illegal symbols? (carbon+cocoa)
  • Next by thread: Re: A strange behavior of unionSet?
  • Index(es):
    • Date
    • Thread