• 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: Koen van der Drift <email@hidden>
  • Date: Sat, 11 Aug 2012 07:10:59 -0400

A follow up question.

Now I got the filtering sorted out, I'd also like to be able to change all values in the same NSTableColumn based on a check box.

Say my entity has two properties valueA and valueB; if the checkbox is checked, then the column should show valueA, otherwise it should show valueB.


I changed the NSPredicate as follows:

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


But the column is bound to valueA in IB, so it will always show valueA.

Is there a way with bindings to have the column display either valueA or valueB based on the checkbox?  Do I need to go back to using a data source?


Thanks again,

- Koen.







On Aug 11, 2012, at 5:14 AM, Koen van der Drift <email@hidden> wrote:

>
> On Aug 10, 2012, at 1:44 PM, Ken Thomases <email@hidden> wrote:
>
>> return [NSPredicate predicateWithFormat:@"%f < value && value < %f", self.minimumValue, self.maximumValue];
>
> And we have a winner.
>
> Thanks everyone for thinking along, looks like we all learned something ;-)
>
> - Koen.
>


_______________________________________________

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: Ken Thomases <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>)
 >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: Re: filtering the values in an NSTableColumn
  • 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