@@ -23,11 +23,11 @@ import UIKit import ObjFW class MainViewController: UIViewController, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource { - public var sites = OFArray() + public var sites: [String] = [] public var siteStorage = SiteStorage() @IBOutlet var searchBar: UISearchBar? @IBOutlet var tableView: UITableView? override func viewDidLoad() { @@ -49,16 +49,16 @@ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "site") ?? UITableViewCell(style: .default, reuseIdentifier: "site") - cell.textLabel?.text = sites[indexPath.row].nsObject + cell.textLabel?.text = sites[indexPath.row] return cell } func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) { - sites = siteStorage.sites(withFilter: searchBar.text?.ofObject) + sites = siteStorage.sites(withFilter: searchBar.text) tableView?.reloadData() } func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {