How do you set the text in an NSTextField?

Alexsander Akers picture Alexsander Akers · May 15, 2010 · Viewed 78.3k times · Source

I'm trying to set the text in an NSTextField, but the -setStringValue: and -setTitleWithMnemonic: methods are not working. Any ideas?

Answer

Ken Aspeslagh picture Ken Aspeslagh · May 15, 2010

setStringValue: is the way to do it. You should make sure your outlet is being set properly. (In the debugger, make sure your textfield variable is not null.)