first-responder

Can't type text into UITextField or UITextView in iOS6

夙愿已清 提交于 2019-12-04 22:38:49
In one of my apps, when I try to edit (type some text) UITextField , UITextView or any other 'text-able' UIControl the cursor just blinks but no characters are typed in except BACKSPACE (possible only when I have some initial text in it), RETURN and switching character types. This goes to all controls across whole application. Summary: It happens only from iOS 6.0 (does not occur on iOS 5.x, 4.x neither Simulator or real device) All delegate methods are fired (shouldBeginEditing: didBeginEditing:) except shouldChangeCharactersInRange: isFirstResponder flag is behaving set correctly

How can “First Responder” be used in a xib file?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 17:25:57
问题 i read about responder chains, and basically i read about how the events from the UI are passed up on the responder chain, how to handle them and how to pass along. I also used -becomeFirstResponder and -resignFirstResponder, but i was using these only for basic tasks, like showing keyboard on iOS and handling shake events. What I would like to know is how can I use the "First Responder" proxy object in the MainWindow.xib that Xcode generates. I see some received actions and also i see that i

Showing UIMenuController loses keyboard

泪湿孤枕 提交于 2019-12-04 11:35:20
问题 I'm making an iphone app similar to the Messages app that comes on the phone. I just set up the ability to copy messages via a UIMenuController, but if the keyboard is showing and someone tries to copy a message, the keyboard goes away (presumably because of my [cell becomeFirstResponder]; where cell is the message cell being copied). Is there a way to show the Copy message without losing the keyboard? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath

Why does setting initialFirstResponder have no effect?

本秂侑毒 提交于 2019-12-04 05:45:22
I have a simple form (NSWindow) with 3 text fields. NSWindow's initialFirstResponder is 'pointing' to the first field ( NSTextField ). All three text fields are circularly linked to each other via nextKeyView . Problem that I have is that when I start the application from Xcode it'll focus on the text field that was last active (in focus) when the application closed. So for example, if I name text fields A, B and C and initialFirstResponder is set to A. Now if I start the application, focus on B, and close the application, next time I start it, the focus will be on B. Why is that and how would

How to “transfer” first responder from one UIView to another?

谁说我不能喝 提交于 2019-12-03 21:47:43
问题 I have a UIView subclass ( CustomView for purposes of this question) that has its own handling of all touches events (Began, Moved, Ended, Cancelled). I also have a UIButton that is a sibling of CustomView that overlaps it. For example, my view hierarchy looks like this: UIView (Controller's view) CustomView with frame (0, 0, 300, 300) UIButton with frame (0, 0, 100, 50) I would like the CustomView to capture touch events once the user has dragged out of the UIButton. Through debug logging,

Problems setting FirstResponder in Cocoa Mac OSX

纵然是瞬间 提交于 2019-12-03 16:27:06
Im working on a tiny app just to learn cocoa, and Im having a hard time with setting FirstResponder to some NSTextFields. When the view opens, I want the first NSTextField, clientNumber, to be selected, so I trigger [clientNumber becomeFirstResponder] at the end of my loadView method, but it does not select the text field. But when I click the button that fires the (IBAction)addToArray method, it selects the right text field. Further do I have another text field, it should contain integers only, so I have a crude verification for it. When the content is not a int, I get a beep, just like it

UiTextField and resignFirstResponder

被刻印的时光 ゝ 提交于 2019-12-03 16:15:39
I have a weird setup. I have a View called View1 and a ViewController call viewController1 in IB , View1 is a child of the ViewController1 . Inside View1 , I created using code a UITextField and added as a subview. In my Viewcontroller , I have viewController1 : UIViewController <UITextFieldDelegate> Now.. I would like to resign the keyboard when the text field within View1 gets the "Done" button in the keyboard so I have - (BOOL)textFieldShouldReturn:(UITextField *)TEXTFIELD { [TEXTFIELD resignFirstResponder]; } Now the question is, how do I make the connection between TEXTFIELD (defined in

How can “First Responder” be used in a xib file?

主宰稳场 提交于 2019-12-03 10:19:34
i read about responder chains, and basically i read about how the events from the UI are passed up on the responder chain, how to handle them and how to pass along. I also used -becomeFirstResponder and -resignFirstResponder, but i was using these only for basic tasks, like showing keyboard on iOS and handling shake events. What I would like to know is how can I use the "First Responder" proxy object in the MainWindow.xib that Xcode generates. I see some received actions and also i see that i can create actions on the Identity inspector tab. So my question is: how can I use these actions, and

Dismissing the First Responder/Keyboard with multiple Textfields

瘦欲@ 提交于 2019-12-03 09:59:08
问题 Like seriously after going through this... Easy way to dismiss keyboard? ... I have multiple TextFields and a few TextViews . Is there not a way to a have a batch or group Dismiss First Responder for all text fields? Will I need to make method for each field? Maybe I overlooked something in that link? Maybe I can follow something like this: https://stackoverflow.com/questions/3282837/problem-with-multiple-textfields-to-make-the-keyboard-dissapear Would the latter make sense? Thanks in advance

Dismissing the First Responder/Keyboard with multiple Textfields

安稳与你 提交于 2019-12-03 00:29:56
Like seriously after going through this... Easy way to dismiss keyboard? ... I have multiple TextFields and a few TextViews . Is there not a way to a have a batch or group Dismiss First Responder for all text fields? Will I need to make method for each field? Maybe I overlooked something in that link? Maybe I can follow something like this: https://stackoverflow.com/questions/3282837/problem-with-multiple-textfields-to-make-the-keyboard-dissapear Would the latter make sense? Thanks in advance. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- I figured it out.... Controller.h @interface