On Jan 9, 2017, at 8:29 PM, Jens Alfke <j...@mooseyard.com> wrote:
> On Jan 9, 2017, at 6:38 PM, Aaron Tuller <mandelb...@mac.com> wrote:
>> Try doing
>> name.#first
>> as FIRST and LAST are reserved words and need escaping:
> 
> Thanks for the answer. Unfortunately this is a library that will allow 
> developers to provide their own predicate strings, and I can imagine this 
> causing confusion (and therefore support requests for us.)
> 
> I added a workaround to my code that will recognize the weird predicates 
> formed by using unescaped ‘first’ and ‘last’, and handle them appropriately. 
> I hope that’ll be robust enough!

If that's the case, why not just provide your library's API in terms of 
NSPredicate objects?

Then if your users want to use a predicate string (rather than an 
NSPredicateEditor or other form of direct instantiation) they still trivially 
can, but it's on them to get the syntax correct rather than on you to try to 
figure out their intent.

  -- Chris


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to