IOS 6 keyboard not responding

I have a problem since I am updating Xcode 4.4 to 4.5. When I launch my application, I have a search bar controller, when I click on it, the keyboard looks like before, but I can’t write something using the Mac keyboard or the simulator keyboard.

But, when I use my ShareKit button, a view appears on the toolbar. If I try to use my search bar controller after showing this ShareKit view, it will work!

These methods are called:

- (void)searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller - (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller 

But these methods are not called because the keyboard is not responding, and I cannot type.

 -(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption 

But when I use this method:

 - (IBAction)share:(id)sender { if (!_url) { return; } SHKItem *item = [SHKItem URL:_url title:@"Share this URL"]; SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item]; // ShareKit detects top view controller (the one intended to present ShareKit UI) automatically, // but sometimes it may not find one. To be safe, set it explicitly [SHK setRootViewController:self]; [actionSheet showFromToolbar:self.navigationController.toolbar]; } 

After I can use the search bar keyboard.

Can someone help me because it worked great in front of the iOS 6 simulator ...

Thanks!

EDIT : Thank you so much for helping him work!

I just check "Visible at startup" for my Window Main.index.xib element and it works!

Hope this helps some others!

+6
source share
1 answer

You need to set the delegate correctly. Write this line in ViewDidLoad

  SearchbarObj.delegate=self; 

or set delegation of the connection to the file owner in xib.

0
source

Source: https://habr.com/ru/post/925911/


All Articles