• 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: How to force validation of a NSTextField?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to force validation of a NSTextField?


  • Subject: Re: How to force validation of a NSTextField?
  • From: Jeff Gilbert <email@hidden>
  • Date: Sat, 16 Mar 2002 14:19:43 -0600

Try - (void)validateEditing defined for NSControl. I have not tried it, but the description sounds promising.

Jeff Gilbert

On Saturday, March 16, 2002, at 02:04 PM, Thomas Lachand-Robert wrote:

The title says most of the problem: I have an app with several TextFields,
and a "Run" button. Clicking the latter should validate whichever text field is currently edited (if any) and then do domething. But I can't have the validation part. I tried the following for the "Run" action:

id r = [[NSApp mainWindow] firstResponder];
if ([r isKindOfClass:[NSTextView class]] && [r isFieldEditor]) {
r = [r delegate];
[r resignFirstResponder];
}

I checked that r is actually the text field at the end (before that, it is the field editor), but resignFirstResponder has no effect at this point. I tried validateEditing, too, and it doesn't work either.

Probably there is somthing I don't see in the doc, or what?


Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
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.

  • Follow-Ups:
    • Re: How to force validation of a NSTextField?
      • From: Thomas Lachand-Robert <email@hidden>
References: 
 >How to force validation of a NSTextField? (From: Thomas Lachand-Robert <email@hidden>)

  • Prev by Date: Re: Make characters same width in textview
  • Next by Date: Theory, Practice, Down-Time...
  • Previous by thread: How to force validation of a NSTextField?
  • Next by thread: Re: How to force validation of a NSTextField?
  • Index(es):
    • Date
    • Thread