I've got an array of filepaths and I've got a NSPredicateEditor setup in my UI where the user can combine a NSPredicate to find a file. He should be able to filter by name, type, size and date.
There are several problems I have now:
- I can only get one predicate object from the editor. When I use "predicateForRow:" it returns (null)
- If the user wants to filter the file by name AND size or date, I can't just use this predicate on my array anymore because those information are not contained in it
Can I split up a predicate into different predicates without converting it into a NSString object, then search for every @" OR " | @" AND " and seperating the components into an array and then converting every NSString into a new predicate?
In the NSPredicateEditor settings I've some options for the "left Expression": Keypaths, Constant Values, Strings, Integer Numbers, Floating Point Numbers and Dates. I want to display a dropdown menu to the user with "name", "type", "date", "size". But then the generated predicate automatically looks like this:
"name" MATCHES[c] "nameTest" OR "type" MATCHES[c] "jpg" OR size == 100
Because the array is filled with strings, a search for "name", "type" etc. and those strings do not respond to @"myString"*.name*m the filter always returns 0 objects. Is there a way to show the Name, Type, Size and Date in the Menu, but write "self" into the predicate without doing it by hand?
I've already searched in the official Apple tutorials, on Stackoverflow, Google, and even Youtube to find a clue. This problem troubles me for almost one week now. Thanks for you time! If you need more information please let me know!