I'm having a few issues in building a search bar for searching a list of work types for a project I am building. I am getting a lot of red exclamation points saying "tblSearchResults" is an unresolved identifier.
Here is a the project source code where the issue is occurring.
func WorkTypeSearchable() {
let pathToFile = NSBundle.mainBundle().pathForResource("work", ofType: "txt")
if let path = pathToFile {
let workString = String(contentsOfFile: path, encoding:
NSUTF8StringEncoding, error: nil)!
let WorkTypeSearchable = workString.componentsSeparatedByString("\n")
tblSearchResults.reloadData()
}
}
Can you explain why I would be getting an error as an unresolved identifier, as well as well an error with my string for "workString = String(code)...
I am using all the appropriate classes as seen here:
class ViewController: UIViewController, UIPickerViewDataSource,
UIPickerViewDelegate, UITableViewDelegate, UITableViewDataSource,
UISearchResultsUpdating, UISearchBarDelegate {
Note that I am also using a picker later in the program.