• 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
Re: simulating <enter> in a text field by pressing a button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simulating <enter> in a text field by pressing a button


  • Subject: Re: simulating <enter> in a text field by pressing a button
  • From: Joel Reymont <email@hidden>
  • Date: Wed, 09 Jan 2013 21:58:39 +0000

I got it to work. The key is to explicitly load the Nib in the
constructor of my NSViewController subclass

- (id)init
{
    [NSBundle loadNibNamed:kNibName owner:self];

    self = [super initWithNibName:kNibName bundle:nil];
    ...
}

Checking the result of commitEditing when the user clicks my Add
button works fine. The caveat is that I have to check to see if my
target NSString's value is nil before I programmatically close my
modal sheet.

The target string can be nil if the user chose to discard changes in
the error panel that pops up on validation.

--------------------------------------------------------------------------
for hire: mac osx device driver ninja. kernel, usb and coreaudio drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------
_______________________________________________

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

References: 
 >simulating <enter> in a text field by pressing a button (From: Joel Reymont <email@hidden>)
 >Re: simulating <enter> in a text field by pressing a button (From: "email@hidden" <email@hidden>)
 >Re: simulating <enter> in a text field by pressing a button (From: Joel Reymont <email@hidden>)
 >Re: simulating <enter> in a text field by pressing a button (From: Joel Reymont <email@hidden>)

  • Prev by Date: Re: simulating <enter> in a text field by pressing a button
  • Next by Date: Cocoaheads Lake Forest meets tonight
  • Previous by thread: Re: simulating <enter> in a text field by pressing a button
  • Next by thread: NSData, NSImageView value binding, and NSUnarchiveFromData - nothing appears
  • Index(es):
    • Date
    • Thread