Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISearchBar not taking keyboard input but accepting Siri input on iOS 6

I wrote some time ago an app using a Navigation Controller. One of the pushed views contains a UISearchDisplayController and a UISearchBar. The code worked perfectly up to iOS 5. If I compile it to target iOS 6, when selecting the search bar the keyboard appears but the search bar does not seem to accept/receive the keyboard input; however it does accept Siri's input and the search is then performed properly. This happens whether or not I set the search bar as the first responder when the view is loaded (ViewDidLoad method). If I recompile the code to target iOS5 it does work again.

like image 271
Jorge Avatar asked Oct 07 '22 10:10

Jorge


1 Answers

I encountered the same problem similar problem. In my case the problem was that the window that contains the UISearchBar was not the "key window." I solved the problem by calling makeKeyWindow on my application delegate's window.

[[[MyAppDelegate App] window] makeKeyWindow];
like image 85
Larry Avatar answered Oct 10 '22 03:10

Larry