• 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 like NSLiteralSearch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPredicate like NSLiteralSearch


  • Subject: Re: NSPredicate like NSLiteralSearch
  • From: Jim Turner <email@hidden>
  • Date: Tue, 15 Dec 2009 10:13:19 -0600

I believe you need the diacritic insensitive option:

'someProperty BEGINSWITH[d] "?"'

Look up NSComparisonPredicate options in the documentation for more
discussion.  As for what the 'w' means, it's Spotlight specific.  "The
Comparison is word based, and also detects transitions from lower-case
to upper-case."

http://developer.apple.com/Mac/library/documentation/Carbon/Conceptual/SpotlightQuery/Concepts/QueryFormat.html

--
Jim
http://nukethemfromorbit.com



On Tue, Dec 15, 2009 at 1:30 AM, Gerriet M. Denkmann
<email@hidden> wrote:
>
> This works. i.e. returns {0,1}:
> NSRange r2 = [ @"???" rangeOfString: @"?" options: NSAnchoredSearch | NSLiteralSearch ];
> (without NSLiteralSearch it returns NSNotFound).
>
> but an NSPredicate with: "someProperty BEGINSWITH "?" " does NOT find ???".
> (the NSPredicate is to be used with -[NSArrayController setFilterPredicate:] to query Core Data).
>
> So: is there some string_option equivalent to NSLiteralSearch?
>
> And a related question: where are the available string_options defined?
> The Predicate Programming Guide has:
> string_options ::= c | d | cd
>
> but also an example with "w":
> ((* = "FooBar*"wcd)) || (kMDItemTextContent = "FooBar*"cd))
>
> 10.6.2
>
> Kind regards,
>
> Gerriet.
>
> _______________________________________________
>
> 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
>
_______________________________________________

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: NSPredicate like NSLiteralSearch
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >NSPredicate like NSLiteralSearch (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: pls explain rotated iPhone coordinates to me
  • Next by Date: Re: Localization.strings in UTF16 vs UTF8
  • Previous by thread: NSPredicate like NSLiteralSearch
  • Next by thread: Re: NSPredicate like NSLiteralSearch
  • Index(es):
    • Date
    • Thread