• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
makeFirstResponder returns NO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

makeFirstResponder returns NO


  • Subject: makeFirstResponder returns NO
  • From: "Adam Gerson" <email@hidden>
  • Date: Tue, 19 Feb 2008 22:00:03 -0500

I have a simple core data / bindings setup. I have an array controller bound
to an NSTableView to display the data and some NSTextField controls bound to
populate the same data. When the user clicks the plus button that calls the
arrayController's add method the NSTableView becomes the first responder. I
would like one of my NSTextField controls to become the firtstResponder so
that the user can start typing into it, as opposed to the NSTextFieldCell in
the Table. I wrote the following method to do this. First it adds a row then
it sets the FIrstResponder.



- (IBAction)addServerButtonAction:sender {
     [serverArrayController add:self];
     [window makeFirstResponder:protocolTextField];
}


This method works great accept when there is no data in the ArrayController
yet. For any entry after the first one protocolTextField hapily gets focus
with the cursor and becomes firstResponder. However, if the array is empty
and it is the first entry into the array protocolTextField refuses to accept
firstResponder. Its almost as if [serverArrayController add:self] needs a
few seconds to make the TextField enabled and editable before [window
makeFirstResponder:protocolTextField] can work. If I put each line into
separate buttons and click one and then the other, even if its the first
entry, it works fine. But when they are in the same method [window
makeFirstResponder:protocolTextField] returns no.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: makeFirstResponder returns NO
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Dynamic MainMainNib Loading
  • Next by Date: Re: Dynamic MainMainNib Loading
  • Previous by thread: Re: A window that rejects focus
  • Next by thread: Re: makeFirstResponder returns NO
  • Index(es):
    • Date
    • Thread