• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSPredicate help (String value in NSArray?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSPredicate help (String value in NSArray?) (From: Claus Atzenbeck <email@hidden>)

  • Prev by Date: Re: Finding the height of a piece of text
  • Next by Date: NSWorkspaceWillSleepNotification not received
  • Previous by thread: NSPredicate help (String value in NSArray?)
  • Next by thread: NSWorkspaceWillSleepNotification not received
  • Index(es):
    • Date
    • Thread