Code:
let Predicate = NSPredicate(format: "self CONTAINS[cd] %@", searchText)
let result:NSArray = arrCountryList?.filterUsingPredicate(Predicate) as! AnyObject! as! NSArray
arrCountryList = result.mutableCopy() as! NSMutableArray
I have a list of countries in an array.
I try to filter using NSPredicate, but it gives this error.
How to solve this?
let Predicate = NSPredicate(format: "self CONTAINS[cd] %@", searchText)
let result:NSArray = arrCountryList.filteredArrayUsingPredicate(Predicate)
arrCountryList = result.mutableCopy() as! NSMutableArray