由于某种原因,搜索栏没有调用 textDidChange [英] Search bar not calling textDidChange for some reason
问题描述
我对 Xcode 很陌生,所以请原谅我的无知.
我在 ViewController 上有一个 searchBar
和一个 tableView
.我有一个用于 searchBar
的 IBOutlet
,我在 viewDidLoad
中指定了 searchBar.delegate = self
.由于某种原因 textDidChange
在我在搜索栏中输入时没有被调用.
谁能帮我解决这个问题?谢谢.
我搞定了.尽管我在 viewDidLoad
中指定了 searchBar.delegate = self
,但直到我在故事板界面中指定了 searchBar
委托后,它才起作用.>
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.
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.
这篇关于由于某种原因,搜索栏没有调用 textDidChange的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!