• 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
End Editing with RETURN
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

End Editing with RETURN


  • Subject: End Editing with RETURN
  • From: Lorenzo <email@hidden>
  • Date: Thu, 05 Jun 2003 20:18:00 +0200

Hi,
I have some NSTextFields (of my subclass) in a Window.
I want that when the user presses RETURN, more than ending the editing, I
perform an action. I found the delegate methods very useful.

Anyway, the following

- (void)textDidEndEditing:(NSNotification *)aNotification
{
NSLog(@"textDidEndEditing");
}

has been executed any time the user presses TAB or RETURN.
How could I detect the user ended to edit the field pressing a RETURN?
Is this info nested inside the aNotification

The documentation says that:
If the user ended editing by pressing Return, this method tries to send the
receiver's action to its target;

So I tried in many ways to assign an action to the NSTextField subclass
a) [self setAction:@selector(ApplyChanges)];
b) [(NSControl*)self setAction:@selector(ApplyChanges)];
c) [(NSCell*) self setAction:@selector(ApplyChanges)];
and/or [self setTarget:self];

and

- (void)ApplyChanges
{
NSLog(@"ApplyChanges");
}

but it doesn't work. Why?



Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: End Editing with RETURN
      • From: Greg Titus <email@hidden>
  • Prev by Date: Re: launching an app in cocoa
  • Next by Date: OT: Where's flockfile
  • Previous by thread: Re: Unzip tool -- a bit off topic
  • Next by thread: Re: End Editing with RETURN
  • Index(es):
    • Date
    • Thread