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