• 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
NSPredicate containing contains
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPredicate containing contains


  • Subject: NSPredicate containing contains
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Thu, 29 May 2008 01:10:39 +0700

NSString *searchString = @"SpoD";
NSString *predicateFormat = @"kMDItemFSName contains %@";
NSPredicate *predicate = [ NSPredicate predicateWithFormat: predicateFormat, searchString ];


NSMetadataQuery *query = [[NSMetadataQuery alloc] init];
[ query setPredicate: predicate];          //	<---- creates exception

NSComparisonPredicate with left expression which is not NSKeyPathExpressionType given to NSMetadataQuery ("SpoD" IN kMDItemFSName)

When I use beginswith, endswith or == instead of "contains" it works fine.

So how can I find all filenames wich contain a given string? (Btw. "matches" also does not work).

10.4.11.

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


  • Follow-Ups:
    • Re: NSPredicate containing contains
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: NSFileManager's errors in 10.5, where are they documented?
  • Next by Date: Core animation bug?
  • Previous by thread: Re: Repost: NSAlert beeping
  • Next by thread: Re: NSPredicate containing contains
  • Index(es):
    • Date
    • Thread