Re: NSPredicate help (String value in NSArray?)
Re: NSPredicate help (String value in NSArray?)
- Subject: Re: NSPredicate help (String value in NSArray?)
- From: Jaime Magiera <email@hidden>
- Date: Mon, 26 Nov 2007 16:12:28 -0500
On Nov 26, 2007, at 4:09 AM, Claus Atzenbeck wrote:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NSPredicate *containsPredicate = [NSPredicate
predicateWithFormat:@"SELF IN %@", authors];
if ([containsPredicate evaluateWithObject:[self wikiID]]) {
NSLog(@"YES");
} else {
NSLog(@"NO");
}
Hello,
Try this...
NSPredicate *containsAuthorPredicate = [NSPredicate
predicateWithFormat:@"(SELF like %@)", [self wikiID]];
NSArray *validAuthors = [authors filteredArrayUsingPredicate:
containsAuthorPredicate];
if([validAuthors count] > 0)
{
NSLog(@"Yes");
} else {
NSLog(@"No");
}
hth,
Jaime
_______________________________________________
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