first-responder

How do I resignFirstResponder when I click outside of a UITextField onto a UITableView

与世无争的帅哥 提交于 2019-12-10 04:24:46
问题 I am having trouble getting the keyboard in my iPhone app to go away because the UIView even when made a controller is not touchable because of the fact that I have a UITableView taking up the rest of the available screen. I was curious to know how I would go resigning the keyboard aka firstResponder by clicking onto the UITableView ? Is there a way to monitor a touch event on the UITableView even if it is not to select a clickable cell. Basically, I know how to resign the keyboard if the

NSTableView hit tab to jump from row to row while editing

好久不见. 提交于 2019-12-09 06:25:29
问题 I've got an NSTableView. While editing, if I hit tab it automatically jumps me to the next column. This is fantastic, but when I'm editing the field in the last column and I hit tab, I'd like focus to jump to the first column of the NEXT row. Any suggestions? Thanks to Michael for the starting code, it was very close to what ended up working! Here is the final code that I used, hope it will be helpful to someone else: - (void) textDidEndEditing: (NSNotification *) notification { NSInteger

Why does the keyboard not show when a view is popped from the navigation stack?

三世轮回 提交于 2019-12-08 08:07:36
问题 I have several UITextField objects on a view. When I press on them, I get a keyboard and the UIKeyboardWillShowNotification event as well. When I push a new view controller on to the stack while one of the text fields is the first responder, the keyboard animates away (as I expected). When I then press the back button, however, they text field becomes the first responder, but the keyboard doesn't come back up. When I click on a different text field in the same view, again, the keyboard fails

NSButton subclass as colorwell & preventing NSColorPanel from touching the first responder

只愿长相守 提交于 2019-12-08 07:38:59
问题 I followed some examples for making an NSButton subclass work as an NSColorWell (since our NSButton subclass already gives us the appearance behavior we need), however I've noticed that after using the button to invoke the panel and changing the color, it's also changing the color of selected text in our document. If I instead subclassed NSColorWell with our appearance customizations, would it not have this problem? However, I'm still hoping for a work-around that avoids that & still lets us

NSButton subclass as colorwell & preventing NSColorPanel from touching the first responder

末鹿安然 提交于 2019-12-07 11:25:41
I followed some examples for making an NSButton subclass work as an NSColorWell (since our NSButton subclass already gives us the appearance behavior we need), however I've noticed that after using the button to invoke the panel and changing the color, it's also changing the color of selected text in our document. If I instead subclassed NSColorWell with our appearance customizations, would it not have this problem? However, I'm still hoping for a work-around that avoids that & still lets us use our button subclass. I've seen discussion threads suggest letting the button itself become the

Can't type text into UITextField or UITextView in iOS6

故事扮演 提交于 2019-12-06 17:00:47
问题 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:

How to make embedded view controller part of the responder chain?

做~自己de王妃 提交于 2019-12-05 23:31:55
I am developing a Mac app using storyboards. I have a window that presents an NSViewController as its contents, which contains a "container view controller" that embeds an NSSplitViewController . The expected behaviour is for the NSSplitViewController to be part of the responder chain, such that a menu item that triggers the toggleSidebar action on the first responder actually collapses the item of the NSSplitViewController that's marked as a sidebar. However, this simply does not happen and the menu item remains disabled. So my question is, how can-I get the NSSplitViewController to be part

UiTextField and resignFirstResponder

旧街凉风 提交于 2019-12-05 03:18:37
问题 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

iPhone first responders

孤街浪徒 提交于 2019-12-05 03:07:28
I am confused about the iPhone responder chain. Specifically, in the iPhone event handling guide http://developer.apple.com/iPhone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/EventHandling/EventHandling.html , we have the following: The first responder is the responder object in an application (usually a UIView object) that is designated to be the first recipient of events other than touch events. But UIView is a subclass of UIResponder. And the UIResponder class reference says this: - (BOOL)canBecomeFirstResponder Return Value YES if the receiver can become the first

Problems setting FirstResponder in Cocoa Mac OSX

一世执手 提交于 2019-12-05 01:43:08
问题 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