• 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: Remove/Disable NSPredicate from NSMutableSet?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remove/Disable NSPredicate from NSMutableSet?


  • Subject: Re: Remove/Disable NSPredicate from NSMutableSet?
  • From: Graham Cox <email@hidden>
  • Date: Wed, 24 Mar 2010 10:26:01 +1100

On 24/03/2010, at 7:27 AM, Robert Monaghan wrote:

> How does one remove a NSPredicate from an NSMutableSet?
> I want to reuse the NSMutableSet for another purpose, but I have to strip out the Predicate that I assigned.
> Passing "filterUsingPredicate:nil" causes an exception. Is there a way to do this? Or should I generate another NSMutableSet?


I think you're labouring under a misapprehension.

NSMutableSet doesn't 'have a' predicate. You can apply a predicate to a set (mutable or not) to return a new set whose members match the predicate. Once done, the set is a set - it has no memory of the predicate that was used to create it, nor the original unfiltered set.

So you can re-use the set if you want, but it's usually cleaner and easier just to create a new set for a new purpose.

--Graham


_______________________________________________

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

References: 
 >Remove/Disable NSPredicate from NSMutableSet? (From: Robert Monaghan <email@hidden>)

  • Prev by Date: Re: Screen size in Dual monitor mode
  • Next by Date: Re: How to eliminate field editor from NSTextField?
  • Previous by thread: Re: Remove/Disable NSPredicate from NSMutableSet?
  • Next by thread: Appropriate list for GameKit questions?
  • Index(es):
    • Date
    • Thread