I am using NSMutableDictionary for storing data into key value pair and append these dictionary to NSMutableArray.I want to assign my filtered NSMUtablearray to another empty NSMUtablearray, but can not get result and app is crash dunring searching some text..
here is my code:
extension ViewController: UISearchBarDelegate, UISearchDisplayDelegate
{
func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String)
{
let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@", searchText)
let result = ArrData.filtered(using: searchPredicate)
searchCoin.add(result)
searchActive = true
self.tableView.reloadData()
}
}
crash is:
NSMutableDictionaryin this case?NStypes in swift. Use properly typed Swift collections and you will catch errors like this at compile time.