• 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: Core Data: case insensitive "equals" predicate strings!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: case insensitive "equals" predicate strings!?


  • Subject: Re: Core Data: case insensitive "equals" predicate strings!?
  • From: Ken Thomases <email@hidden>
  • Date: Mon, 7 Jan 2008 16:22:02 -0600

On Jan 7, 2008, at 2:29 PM, Frank Reiff wrote:

I've had to resort to the very lame:

NSPredicate* predicate = [NSPredicate predicateWithFormat: @"%K BEGINSWITH[c] %@ AND %K ENDSWITH[c] %@", @"fullDestinationPath", newFullPath];

to get things to work properly.. surely this is not the recommended way of doing case insensitive matching for core data?

I don't see an obvious case-insensitive equals operator. LIKE or MATCHES are tempting, but get you in trouble if either of the arguments include characters that are interpreted as meta-characters.


However, I would not use the BEGINSWITH AND ENDSWITH construction that you're using. That would match if fullDestinationPath happened to contain the concatenation of newFullPath with itself.

I think that something like A CONTAINS[c] B AND B CONTAINS[c] A would be safer.

Still, you're right, it's far from elegant.

-Ken
_______________________________________________

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: Core Data: case insensitive "equals" predicate strings!?
      • From: Frank Reiff <email@hidden>
References: 
 >Core Data: case insensitive "equals" predicate strings!? (From: Frank Reiff <email@hidden>)

  • Prev by Date: Interface Builder Layer Transitions
  • Next by Date: Apple Help and remote help content?
  • Previous by thread: Re: Core Data: case insensitive "equals" predicate strings!?
  • Next by thread: Re: Core Data: case insensitive "equals" predicate strings!?
  • Index(es):
    • Date
    • Thread