1
我收到的錯誤是Type'LocationSearchTable'不符合協議'UISearchResultsUpdating'。大部分回答這個問題的是這種添加到代碼:ViewController不符合協議'UISearchResultsUpdating'
func updateSearchResultsForSearchController(searchController: UISearchController) {
}
不過我已經有這個在我的代碼,這些答案之前和錯誤仍然出現。
這是我的代碼:
import UIKit
class LocationSearchTable : UITableViewController { }
extension LocationSearchTable : UISearchResultsUpdating {
func updateSearchResultsForSearchController(searchController: UISearchController) {
}
}
和錯誤是:
您可能要標記您的答案是正確的答案 –