Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try following lines, and make sure <code>properyName</code> is case sensitive. and you have placed <code>,</code> in predicate format, thats why its not working. just replace your code with following.</p> <p><strong>Objective C</strong></p> <pre><code>NSPredicate *bPredicate = [NSPredicate predicateWithFormat:@"SELF.name contains[cd] %@",self.searchText.text]; self.filteredArray = [self.hotelArray filteredArrayUsingPredicate:bPredicate]; NSLog(@"HERE %@",self.filteredArray); </code></pre> <p><strong>Swift</strong></p> <pre><code>var bPredicate: NSPredicate = NSPredicate(format: "SELF.name contains[cd] %@", self.searchText.text) self.filteredArray = self.hotelArray.filteredArrayUsingPredicate(bPredicate) NSLog("HERE %@", self.filteredArray) </code></pre> <p><strong>Using swift <code>filter</code></strong></p> <pre><code>var searchText = "Galaxy" let filteredArray = hotelArray.filter { $0["name"] == searchText } print("** Result ** \n\(filteredArray)") </code></pre> <p><strong>Swift 3.0</strong></p> <pre><code>let arrEmp = [["name": "James", "age" : 27, "city" : "New york"], ["name": "Johnson", "age" : 24, "city" : "London"], ["name": "Alex", "age" : 28, "city" : "Newark"], ["name": "Mark", "age" : 25, "city" : "Paris"], ["name": "Steve", "age" : 25, "city" : "Silicon Valley"], ["name": "Lary", "age" : 28, "city" : "New york"]] // *** Filter by Name exact match *** var filterByName = arrEmp.filter { $0["name"] == "Mark" } print("filterByName \(filterByName)") // *** Filter by Age *** var filterByAge = arrEmp.filter { $0["age"] as! Int &gt; 25 } print("filterByAge \(filterByAge)") </code></pre> <p><strong>Swift 4.0</strong></p> <pre><code>var filterByName = arrEmp.filter do { $0["name"] == "Mark" } print("filterByName filterByName)") var filterByAge = arrEmp.filter do { $0["age"] as! Int &gt; 25 } print("filterByAge filterByAge)") </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload