• 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: Need help with predicate format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need help with predicate format


  • Subject: Re: Need help with predicate format
  • From: Omar Qazi <email@hidden>
  • Date: Sun, 27 Jul 2008 20:52:37 -0700


On Jul 27, 2008, at 1:37 PM, Fabian wrote:

I want to query all keys in
each dictionary for a given string, i. e. something like "(ANY
SELF.function.collection.keys.value contains %@, searchString)". What
is the most efficient way to do this?

Well, NSArray has a method called containsObject: so,

for (NSDictionary *aDict in myObject.dictionaries) {
	BOOL containsKey = [[aDict allKeys]containsObject:theKey];
	//Do whatever you want with this
}

To be honest, I don't know if this will work, since I don't know if containsObject is checking if the argument is a pointer to an object in the array, or if it is equal to the object, but it's better than nothing, I guess.


Omar Qazi Hello, Galaxy! 1.310.294.1593

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Need help with predicate format
      • From: Graham Cox <email@hidden>
References: 
 >Need help with predicate format (From: Fabian <email@hidden>)

  • Prev by Date: Re: NSPopupButton and bindings to NSArrayController
  • Next by Date: Re: NSGraphicsContext restore crashes my xtension
  • Previous by thread: Need help with predicate format
  • Next by thread: Re: Need help with predicate format
  • Index(es):
    • Date
    • Thread