• 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: Doc-based app, text fields, and losing focus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Doc-based app, text fields, and losing focus


  • Subject: Re: Doc-based app, text fields, and losing focus
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Tue, 25 Nov 2003 15:37:56 -0800

Hello...

For the NSTextField controls, the delegate of the control will have the following method called when the textField is about to lose focus... (see "Methods Implemented by the Delegate" at the end of the docs for NSControl, which is the superclass of NSTextField)

- (void)controlTextDidEndEditing:(NSNotification *)aNotification

For the NSTextView objects, the delegate of the view should have the following method called before the focus shifts away from the textView... (see "Methods Implemented by the Delegate" at the end of the docs for NSTextView)

- (void)textDidChange:(NSNotification *)aNotification

Hope that helps.

Louis


Hi all. I have a doc-based app. On this I have several text fields. What I would like to do is to monitor when focus is lost on a text field, I want to check to see if the field is empty. If so, I want a dialog to prompt the user to enter a value. Basically, I want to make sure every field is filled in.

I know I can use notifications and NSAlert and all of that, but I don't know how to catch it when focus moves to another text field. I have 5 NSTextFields, and 2 NSTextViews.

So, how would I go about catching focus lost on a text field? Just a push in the right direction is all I ask. If anyone knows of any tutorials, that would be cool too.

James
_______________________________________________
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.
_______________________________________________
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.

  • Prev by Date: Re: ZeroLink and dynamic discovered Classes
  • Next by Date: Re: Communication between an NSView and AppController;
  • Previous by thread: Re: Doc-based app, text fields, and losing focus
  • Next by thread: Xcode: Setting window to ignore mouse click events & Build problems
  • Index(es):
    • Date
    • Thread