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

Re: A strange behavior of unionSet?


  • Subject: Re: A strange behavior of unionSet?
  • From: Pete Yandell <email@hidden>
  • Date: Mon, 26 Jan 2004 00:23:23 +1100

On 26/01/2004, at 12:09 AM, Thomas Lachand-Robert wrote:

> 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];

The definition of unionSet from the docs:

- (void)unionSet:(NSSet *)otherSet

So you're assigning the result of a void method to s. You want it
without the assignment:

[s unionSet:set2];


Pete Yandell
http://pete.yandell.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.

  • Follow-Ups:
    • Re: A strange behavior of unionSet?
      • From: Thomas Lachand-Robert <email@hidden>
References: 
 >A strange behavior of unionSet? (From: Thomas Lachand-Robert <email@hidden>)

  • Prev by Date: A strange behavior of unionSet?
  • Next by Date: Re: Cocoa from the command line?
  • Previous by thread: A strange behavior of unionSet?
  • Next by thread: Re: A strange behavior of unionSet?
  • Index(es):
    • Date
    • Thread