• 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 NSFetchRequest with predicate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data NSFetchRequest with predicate


  • Subject: Re: Core Data NSFetchRequest with predicate
  • From: Jerry Krinock <email@hidden>
  • Date: Thu, 01 Mar 2012 22:08:33 -0800

On 2012 Mar 01, at 18:52, M. S. Hrishikesh wrote:

> NSString *key = @"tag";
> NSPredicate *pred = [NSPredicate predicateWithFormat:@"%K like %@",key,@"personality"];

Well, what you're doing looks OK to me, but I'm not sure because I don't often use +predicateWithFormat:.  Since you're apparently spending a lot of time on this, see what happens if you use this method instead:

   +[NSComparisonPredicate predicateWithLeftExpression:
                                       rightExpression:
                                              modifier:
                                                  type:
                                               options:]

Yes it's more lines of code, but it might give you a different result and give you a clue.

And, for me, it would be time well spent because I'm not enough of an artist to use -predicateWithFormat: in a shipping product.  There are just too many ways to introduce bugs.  Write yourself some wrappers around NSComparisonPredicate methods for commonly-used predicate structures.


_______________________________________________

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: 
 >Core Data NSFetchRequest with predicate (From: "M. S. Hrishikesh" <email@hidden>)

  • Prev by Date: Re: Xcode - An Apple Embarrassment
  • Next by Date: Re: Xcode - An Apple Embarrassment
  • Previous by thread: Core Data NSFetchRequest with predicate
  • Next by thread: Re: Round corners of borderless NSWindow without set it transparent
  • Index(es):
    • Date
    • Thread