Thursday, March 19, 2009

getting and setting the string value of an NSTextField

I can't believe what a mess I made of this, when it's so easy:

[textField stringValue] gets the contents of the field.

[textField setString:@"some text"] updates the field.

Of course, there's always Key-Value Coding and Key-Value Observing if you want to make it harder on yourself...

No comments:

Post a Comment