当我显示 optionsSheet 时,我遇到了隐藏键盘的问题。
我的代码中的问题在哪里?
- (void)optionsSheet2{
if(optionsSheet2) {
[optionsSheet2 dismissWithClickedButtonIndex:-1 animated:YES];
optionsSheet2 = nil;
}
optionsSheet2 = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"Cancel", nil) destructiveButtonTitle:nil otherButtonTitles:NSLocalizedString(@"Delete", nil), NSLocalizedString(@"Delete all", nil), nil];
[optionsSheet2 showInView:self.parentViewController.view];
}
- (void)dismissKeyboard {
[_uiSearchBar resignFirstResponder];
[_uiSearchBar setShowsCancelButton:NO animated:YES];
[_uiSearchBar setHidden:true];
[self.view endEditing:YES];
}