草庐IT

keyboardWasShown

全部标签

iphone - "unrecognized selector sent to instance"键盘出现时

当我在我的应用程序屏幕中单击一个文本字段并且键盘出现时,xcode调试器显示此错误:[mainViewControllerkeyboardWasShown]:unrecognizedselectorsenttoinstance0x5867ac0在mainViewController的viewDidLoad方法中,我这样调用registerForKeyboardNotifications方法:[自行注册键盘通知];这是它的实现(在mainViewController.m中):-(void)registerForKeyboardNotifications{[[NSNotificationC

iphone - 没有在我的 UITextView 上调用 keyboardWasShown 方法

我有一个UITextView,我实现了一个keyboardWasShownMethod,如下所示:(void)keyboardWasShown:(NSNotification*)aNotification{NSDictionary*info=[aNotificationuserInfo];CGSizekbSize=[[infoobjectForKey:UIKeyboardFrameBeginUserInfoKey]CGRectValue].size;CGRectbkgndRect=inkTextField.superview.frame;bkgndRect.size.height+=k