• 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: filtering the values in an NSTableColumn
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: filtering the values in an NSTableColumn


  • Subject: Re: filtering the values in an NSTableColumn
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 10 Aug 2012 12:44:33 -0500

On Aug 10, 2012, at 12:28 PM, Fritz Anderson wrote:

> They are not alternatives, and the conversion to NSNumber is not optional. You have to do all three.

What?  There's no requirement that one use NSNumbers.  And BETWEEN is a nice clear operator to use, but it would be fine to do "%f < value && value < %f".  In fact, the docs for BETWEEN state that it's equivalent to that sort of thing (except using <= instead of <, which the OP should consider which he wants).

A perfectly suitable solution is:

- (NSPredicate*) minMaxPredicate
{
	return [NSPredicate predicateWithFormat:@"%f < value && value < %f", self.minimumValue, self.maximumValue];
}

+ (NSSet *) keyPathsForValuesAffectingMinMaxPredicate
{
	return [NSSet setWithObjects:@"minimumValue", @"maximumValue", nil];
}

Regards,
Ken


_______________________________________________

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: filtering the values in an NSTableColumn
      • From: Koen van der Drift <email@hidden>
    • Re: filtering the values in an NSTableColumn
      • From: Fritz Anderson <email@hidden>
    • Re: filtering the values in an NSTableColumn
      • From: Kyle Sluder <email@hidden>
References: 
 >filtering the values in an NSTableColumn (From: Koen van der Drift <email@hidden>)
 >Re: filtering the values in an NSTableColumn (From: Koen van der Drift <email@hidden>)
 >Re: filtering the values in an NSTableColumn (From: Ken Thomases <email@hidden>)
 >Re: filtering the values in an NSTableColumn (From: Koen van der Drift <email@hidden>)
 >Re: filtering the values in an NSTableColumn (From: Keary Suska <email@hidden>)
 >Re: filtering the values in an NSTableColumn (From: Koen van der Drift <email@hidden>)
 >Re: filtering the values in an NSTableColumn (From: Fritz Anderson <email@hidden>)
 >Re: filtering the values in an NSTableColumn (From: Koen van der Drift <email@hidden>)
 >Re: filtering the values in an NSTableColumn (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: filtering the values in an NSTableColumn
  • Next by Date: Re: Formatting a set of NSDecimalNumber values
  • Previous by thread: Re: filtering the values in an NSTableColumn
  • Next by thread: Re: filtering the values in an NSTableColumn
  • Index(es):
    • Date
    • Thread