Re: Checking One Array Against Another
Re: Checking One Array Against Another
- Subject: Re: Checking One Array Against Another
- From: Pierce Freeman <email@hidden>
- Date: Sat, 29 Nov 2008 10:30:47 -0800
- Thread-topic: Checking One Array Against Another
Klaus:
For whatever reason, Xcode is telling me that "error: void value not ignored
as it ought to be" when I try to make badApplicationsSet a mutable set.
Sincerely,
Pierce F.
On 11/29/08 10:22 AM, "Klaus Backert" <email@hidden> wrote:
>
> 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