Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextField Selection Problem



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.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.