I have created a nib file with a normal IBOulet for a NSTextField.
In IB (4.4), add a NSNumberFormatter for this NSTextField and give this some properties, like Decimal Style, max and min values, etc.
Now, I want to modify in code, some other properties for this NSNumberFormatter already embedded in the textfield, like SetGroupingSeparator, SetMaximunFractionDigits etc.
Let say my NSTextField is named pf,
normally I can access the value (string) in the cell as:
[pf SetFloatValue]
or
myFloat = [pf floatValue].
That is working without any problems.
However, I have been unable to find in the documentation or anywhere an example how to modify the NSNumberFormatter properties in code.
I know how to create a NSNumberFormatter in code, but do not know how to assign it to the NSTextField (which I don’t know if will overrides the one create in IB).
Could anyone help me with a clear example how to do this?.
To create and set a NSNumberFormatter to a NSTextField in code can be done via:
The details for which I found in Apple’s Data Formatting Guide
Modifying a formatter should be pretty similiar, accessing the formatter via
[NSCell formatter]: