Re: How to use NSMutableArray's filteredArrayUsingPredicate
Re: How to use NSMutableArray's filteredArrayUsingPredicate
- Subject: Re: How to use NSMutableArray's filteredArrayUsingPredicate
- From: "stephen joseph butler" <email@hidden>
- Date: Tue, 18 Dec 2007 22:24:05 -0600
On Dec 18, 2007 10:16 PM, Eric Gorr <email@hidden> wrote:
> Unless there is something about this solution that does not work, the
> answer appears to be:
>
> NSArray *filteredArray = [myArray filteredArrayUsingPredicate:
> [NSPredicate predicateWithFormat:[NSString
> stringWithFormat:@"Abbreviation LIKE \"%@\"", lookFor]]];
>
> If there are any other interesting, I would be interested.
> If there is any wrong with this one, I would be interested.
You misunderstood the "WithFormat:" part:
<http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/Articles/pSyntax.html#//apple_ref/doc/uid/TP40001795>
For example:
[NSPredicate predicateWithFormat:@"Abbreviation LIKE %@", lookFor]
_______________________________________________
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