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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to