2015-08-23 250 views
0
func updateSearchResultsForSearchController(searchController: UISearchController) { 

    self.filteredfarger.removeAll(keepCapacity: false) 

在這裏,我得到的錯誤錯誤消息

"Immutable value of type '[(String)]' only has mutating members named 'removeAll'"

let searchPredicate = NSPredicate(format: "SELF CONTAINS[c] %@", searchController.searchBar.text!) 
    let array = (self.TitleList as NSArray).filteredArrayUsingPredicate(searchPredicate) 
    self.filteredfarger = array as! [String] 

在這裏,我得到的錯誤:

"Cannot assign 'filteredfarger' in 'self'

self.tableView.reloadData() 
} 

非常感謝你的幫助

+0

您可以加入到你的問題的性質'self.filteredfarger'聲明? – LuckyStarr

回答