Re: Determine keys used in NSPredicate
Re: Determine keys used in NSPredicate
- Subject: Re: Determine keys used in NSPredicate
- From: Chris Hanson <email@hidden>
- Date: Sun, 20 Oct 2013 12:14:42 -0700
On Oct 19, 2013, at 9:44 PM, Trygve Inda <email@hidden> wrote:
> How can I look at myPredicate and determine that it uses dynamicPropertyA?
>
> Is it enough and safe to use [myPredicate predicateFormat] and then search
> the resulting string for dynamicPropertyA?
Once you have an NSPredicate, you can use the various methods on it and its subclasses to recourse through the predicate and find any key path expression objects, and get the key paths they use.
Doing so doesn't rely on the result of -predicateFormat and it uses entirely public API.
-- Chris
_______________________________________________
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