I am used to doing this in Cocoa-touch, so I assumed it would be quite simple. I have already tried:
field.text = [nsstring stringwithformat:@"%i", number];
[field setText:@"%i", number];
and setString, all to no avail.
This will work:
[field setStringValue:[NSString stringWithFormat:@"%i",number]];
If it doesn't do anything, it probably means field
isn't set to point to the field (e.g. by making a connection in Interface Builder).
You should be able to use the setStringValue: method that NSTextField inherits from NSControl.
The full signature is:
- (void)setStringValue:(NSString *)aString
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With