如何从字典的多个键中搜索数据?

How to search data from multiple keys of dictionary?

在我的具有搜索功能的应用程序中,我想从多个键中搜索值。这是我的词典:

 notifications =     (
                {
            "beautician_name" = "ABC";
            "booking_date" = "2016-12-12";
            "date_time" = "2016-12-12 11:27:42";
            discount = 25%;
            "service_name" = Tanning;
            "sub_service_name" = "Spray Tan";
            title = Cancellation;
        },
        {
            "beautician_name" = "PQR";
            "booking_date" = "2016-12-11";
            "date_time" = "2016-12-12 11:27:42";
            discount = 25%;
            "service_name" = hair;
            "sub_service_name" = "Spray Tan";
            title = Cancellation;
        },
        {   
            "beautician_name" = "XYZ";
            "booking_date" = "2016-12-15";
            "date_time" = "2016-12-12 11:27:42";
            discount = 25%;
            "service_name" = film;
            "sub_service_name" = "Spray Tan";
            title = Cancellation;
        }
)

我想从这些键中搜索数据:"beautician_name"、"booking_date"、"discount"、"sub_service_name"。我不想断言任何 for 循环等

我还没有测试过,请尝试下面这样的操作。

NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"beautician_name contains[c] %@ OR booking_date contains[c] %@ OR discount contains[c] %@ OR sub_service_name contains[c] %@" ,searchText,searchText,searchText,searchText];
        NSArray *SearchResult = [notifications filteredArrayUsingPredicate:resultPredicate];