I have a NSPredicateEditor from which I want to extract the predicate as a string. I'm using the following code:
[[predicateEditor objectValue] description]
and it extract the predicate in a form like this:
"Author" MATCHES "John"
the problem is that in this predicate I can't find any hint about the first part of the NSPredicateEditor, the ANY/ALL part.
How can I extract it in NSString form? Thanks
The issue here is that for a single case the predicate intrinsically/logically contains "ALL" behavior, without the
"ALL"
string actually needing to be set in the predicate.Logically
"author matches john"
is the same as"ALL(author matches john")
.If you create an
NSCompoundPredicate
and set it as theNSPredicateEditor
'sobjectValue
the "All" row should be displayed automatically, even if the predicate format string itself does not contain the string "ALL". But setting a standardNSPredicate
(rather thanNSCompoundPredicate
) may not give you the ALL row.