My app works fine on iOS7,but crashes on iOS8.
I've seen various question on this topic but never found a good solution for it.
I have an App that's using UITableViewController and UITableViewController has an SearchDisplayController instance call m_searchDisplayController.
When firstly I click on the search bar to search something, the table-view then show the result, and the search bar resignFirstResponder.But again I click on the search bar,the app crashes:
-[MyFavoritesViewController _searchController]: unrecognized selector sent to instance
Here is the stack:
Then I try to add _searchController method to MyFavoritesViewController class,like this:
- (UISearchDisplayController *)_searchController
{
return nil;
}
Then app works OK except search bar's textField cannot be inputing.So I try this:
- (UISearchDisplayController *)_searchController
{
return m_searchDisplayController;
}
And another crash message shows:
-[UISearchDisplayController _searchBarShouldFinalizeBecomingFirstResponder]: unrecognized selector sent to instance
I don't know how to locate the error code, and anyone has solution about this? Thanks in advance.
My situation:
I do some hack in UISearchBar and I change the delegate of searchBar's textField to some object.Originally, the "_searchController" method of system will call to delegate of searchBar's textField, but now, it will call to my object and then crash. I hope it helps.