问题
I'm very new to Xcode so please excuse my ignorance.
I have a searchBar
and a tableView
on a ViewController. I have an IBOutlet
for the searchBar
and I specified searchBar.delegate = self
in viewDidLoad
. For some reason textDidChange
is not getting called when I type in the search bar.
Can anyone help me with this? Thank you.
回答1:
I got it working. Even though I specified searchBar.delegate = self
in viewDidLoad
, it did not work until I specified the searchBar
delegate in the storyboard interface.
来源:https://stackoverflow.com/questions/29109943/search-bar-not-calling-textdidchange-for-some-reason