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 <koenvanderdr...@gmail.com> 
wrote:

> 
> On Aug 10, 2012, at 1:44 PM, Ken Thomases <k...@codeweavers.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to