• 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: Keary Suska <email@hidden>
  • Date: Fri, 10 Aug 2012 06:42:41 -0600

On Aug 10, 2012, at 5:07 AM, Koen van der Drift wrote:

>
> On Aug 9, 2012, at 10:47 AM, Ken Thomases <email@hidden> wrote:
>
>> Better would be to create a property on your controller which returns the predicate, constructing it on demand for each call (perhaps with some smart caching).  (I'll call the property "minMaxPredicate" for discussion.)  Bind the array controller's filterPredicate binding to that property on your controller.  Then, arrange for KVO change notifications to be emitted for the property when the minimum and maximum value properties change.  The easiest way to do this is to add a method like the following to your class:
>>
>> + (NSSet *) keyPathsForValuesAffectingMinMaxPredicate
>> {
>> 	return [NSSet setWithObjects:@"minimumValue", @"maximumValue", nil];
>> }
>
>
> Thanks Ken.  I implemented this all, but are having some trouble with the correct syntax for the predicate I'll use for this:
>
> I added this to my Controller loadview method:
>
>    self.minMaxPredicate = [NSPredicate predicateWithFormat:@"%f < value < %f", self.minValue, self.maxValue];
>
> Where the float "value"  is a property of the entity that I am displaying in the table and self.minValue and self.maxValue are floats bound to my NSTextFields.
>
> But no matter what I try, I get an error "Unable to parse the format string".
>
>
> Any suggestions?


Where in the predicate formatting guide (https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Predicates/predicates.html) does it show that your syntax is in any way valid?

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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>
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>)

  • Prev by Date: MPMoviePlayerController doesn't work with remoteControlReceivedWithEvent
  • Next by Date: Re: filtering the values in an NSTableColumn
  • Previous by thread: Re: filtering the values in an NSTableColumn
  • Next by thread: Re: filtering the values in an NSTableColumn
  • Index(es):
    • Date
    • Thread