Re: filterPredicate not effecting NSArrayController
Re: filterPredicate not effecting NSArrayController
- Subject: Re: filterPredicate not effecting NSArrayController
- From: "email@hidden" <email@hidden>
- Date: Thu, 22 Nov 2012 09:54:14 +0000
On 22 Nov 2012, at 00:27, Erik Stainsby <email@hidden> wrote:
>
>
>
> The tableView is bound to an arrayController object in XIB, which is in turn a ref to this (weak) peopleArrayController in the windowController.
>
> The predicates (whichever is triggered) print to log just as expected.
The docs give the following example on an NSArray
NSMutableArray *array =
[NSMutableArray arrayWithObjects:@"Miguel", @"Ben", @"Adam", @"Melissa", nil];
NSPredicate *bPredicate = [NSPredicate predicateWithFormat:@"SELF beginswith[c] 'a'"];
NSArray *beginWithB = [array filteredArrayUsingPredicate:bPredicate];
Perhaps the following will improve things:
NSPredicate * p = [NSPredicate predicateWithFormat:@"(SELF firstName contains[cd] %@)
OR (SELF lastName contains[cd] %@) OR (SELF organization contains[cd] %@)", searchText, searchText, searchText];
Does
Regards
Jonathan Mitchell
Mugginsoft LLP
================================================
KosmicTask - the Integrated Scripting Environment for OS X.
http://www.mugginsoft.com/KosmicTask
================================================
_______________________________________________
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