I have an app where i can search for a room to book it.
In my first view I can select a city and the street. In the second view I can select some attributes (like wlan, tv...)
In the 3rd view are the rooms that are available to the selection.
When I don't select an attribute, it should show me all the rooms that are available for the selected street/city.
Here is my predicate so far:
NSPredicate *predicate =
[NSPredicate predicateWithFormat:
@"((raumattribute.schalter CONTAINS YES) AND\
(strasse.checks CONTAINS YES OR strasse.standort.ortcheck CONTAINS YES)) \
OR\
((raumattribute.schalter CONTAINS NO) AND\
(strasse.checks CONTAINS YES OR strasse.standort.ortcheck CONTAINS YES))"];
The problem is, i can't filter the rooms anymore with the attributes. When I select the city and go to the rooms, I can see all the rooms in the city. But as soon as I select an attribute it doesn't filter the rooms, but shows all the rooms in the selected city.
When I write my predicate like this:
NSPredicate *predicate =
[NSPredicate predicateWithFormat:
@"((raumattribute.schalter CONTAINS YES) AND\
(strasse.checks CONTAINS YES OR strasse.standort.ortcheck CONTAINS YES))
I can filter the rooms with the streets and the attributes. .But when no attribute is selected, I can't see any room in the selected street.
here is a Screenshot of my updated schema: Screenshot