• 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: Checking One Array Against Another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Checking One Array Against Another


  • Subject: Re: Checking One Array Against Another
  • From: Klaus Backert <email@hidden>
  • Date: Sat, 29 Nov 2008 19:22:23 +0100


On 29.11.2008, at 19:00, Pierce Freeman wrote:

The only problem with running that is that I get a error in the log and it
doesn't seem to be working:


-[NSCFSet minusSet:]: mutating method sent to immutable object

My slightly modified code is below:

NSMutableSet *openApplicationsSet = [NSSet setWithArray:openApplications];

NSSet *allowedApplicationsSet = [NSSet
setWithArray:applicationsAllowedMutableArray];

NSSet *badApplicationsSet = [openApplicationsSet
minusSet:allowedApplicationsSet];

badApplicationsSet is – as NSSet * – NOT mutable here, but you want to mutate it – just as the compiler told you: "mutating method sent to immutable object".


NSMutableSet * badApplicationsSet = ...

NSLog(badApplicationsSet);

Better, to avoid more crashs, would be:

NSLog(@"badApplicationsSet: %@", badApplicationsSet);

Klaus

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Checking One Array Against Another
      • From: Pierce Freeman <email@hidden>
References: 
 >Re: Checking One Array Against Another (From: Pierce Freeman <email@hidden>)

  • Prev by Date: Re: Keystrokes for non-ascii letters
  • Next by Date: Re: Checking One Array Against Another
  • Previous by thread: Re: Checking One Array Against Another
  • Next by thread: Re: Checking One Array Against Another
  • Index(es):
    • Date
    • Thread