• 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
NSTextField Selection Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextField Selection Problem


  • Subject: NSTextField Selection Problem
  • From: Tom Gray <email@hidden>
  • Date: Sat, 7 Dec 2002 09:14:28 -0500

As always, thanks for the help guys!

Here is my problem.

I have a series of NSTextFields into which a user of my application is entering some preference information. I validate the information entered with control:textShouldEndEditing:

What I want to do is to select the current NSTextField value in the control:textShouldEndEditing: method. I have tried to do that with [myNSTextField selectText:nil] but I seem to be in a recursive loop!

From what I can ascertain, adding the [myNSTextField selectText:nil] line to my control:textShouldEndEditing: method creates an infinite loop!

It appears like the [myNSTextField selectText:nil] method causes the control:textShouldEndEditing: method to be called.

So, the goal is to validate the text in an NSTextField and to select the text if it is not valid.

(In my simple case I am simply checking the length of a user entered password.)

Tom Gray
-------------
email@hidden
or
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: NSTextField Selection Problem
      • From: Chris Giordano <email@hidden>
  • Prev by Date: carbon events in cocoa app...
  • Next by Date: Override NSDocumentController?
  • Previous by thread: Re: carbon events in cocoa app...
  • Next by thread: Re: NSTextField Selection Problem
  • Index(es):
    • Date
    • Thread