UISearchBar delegate not responding to cancel button
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a UIViewController that is a UISearchBarDelegate and a MKMapViewDelegate . The searchBarSearchButtonClicked event works fine, but when testing in iOS 4.2 the searchBarCancelButtonClicked never gets called when hitting the cancel button. In 4.3 everything works fine. I have other views with identical code and it works fine. I have triple checked the method signatures. Could it be something to do with the MapView, or am I doing something blatantly wrong? My .h file: @interface MyViewController : UIViewController <UISearchBarDelegate