Here is step wise how to set text in NSTextField programatically,
First,
If you are using storyboards for app development.
Connect button storyboard to code class file i.e. .h header & .m method file or incase of swift class file of source code
Second,
Let assume that you have connected your NSTextField / Label as:
@property (nonatomic, assign) IBOutlet NSTextField *namedTextField;
Third,
So you will use dot operator called .stringValue & Here is how it can be done two ways:
First Way:
self.namedTextField.stringValue = @“App Name”;
Second Way:
[self.namedTextField setStringValue:pointerName];
Precaution: Make sure your textfield variable is not null
Hope it helps,
Thanks & Regards
Mandar Apte