Re: simulating <enter> in a text field by pressing a button
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