NSTextField value changes after tab-through
NSTextField value changes after tab-through
- Subject: NSTextField value changes after tab-through
- From: "Matthew Stone" <email@hidden>
- Date: Mon, 04 Jun 2007 15:43:56 -0500
Dearest Cocoa users,
I have an app with several NSTextFields (the single-line kind you can type
in) that are initially set to an empty string (@""). Later in my program, I
try to check whether or not the field is empty using the IF statement:
if( [textField stringValue] == @"" )
// do something
This returns true on any fields that have not changed AND have not had the
cursor placed on them, either by clicking on the field or by tabbing through
them. I have tried checking if it's empty as I said above, plus:
if( [textField stringValue] == nil)
// do something
if( [textField isEmpty] ) // this one crashes, just thought I'd eliminate
it as a possibility
// do something
I noticed that there is a task of - textDidChange but that only lets me
know if the text *changed* an not whether or not the field is still empty.
I've also tried to NSLog() the strings before and after they've been
tabbed-through and the output is the same. One of my thoughts was to output
the ASCII values of the characters in the string, but I honestly don't know
how nor could I figure out how (I'm no Cocoa expert).
So, does anyone know what, exactly, the string in the NSTextField is after
tabbing through it? And if not, does anyone know how I can find out??
Thanks!
-M. Stone
_________________________________________________________________
Like puzzles? Play free games & earn great prizes. Play Clink now.
http://club.live.com/clink.aspx?icid=clink_hotmailtextlink2
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden